Changeset 3778 for trunk/packages


Ignore:
Timestamp:
Jul 10, 2013 9:41:32 PM (11 years ago)
Author:
ldelgass
Message:

Add image actor support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/GraphicsObject.h

    r3683 r3778  
    1414#include <vtkSmartPointer.h>
    1515#include <vtkProp.h>
     16#include <vtkActor2D.h>
    1617#include <vtkProp3D.h>
    1718#include <vtkProp3DCollection.h>
    1819#include <vtkAssembly.h>
    1920#include <vtkActor.h>
     21#include <vtkImageActor.h>
    2022#include <vtkVolume.h>
    2123#include <vtkProperty.h>
     24#include <vtkImageProperty.h>
    2225#include <vtkVolumeProperty.h>
    2326#include <vtkMath.h>
     
    114117
    115118    /**
     119     * \brief Cast the vktProp to a vtkActor2D
     120     *
     121     * \return NULL or a vtkActor2D pointer
     122     */
     123    inline vtkActor2D *getActor2D()
     124    {
     125        return vtkActor2D::SafeDownCast(_prop);
     126    }
     127
     128    /**
    116129     * \brief Cast the vktProp to a vtkProp3D
    117130     *
     
    131144    {
    132145        return vtkActor::SafeDownCast(_prop);
     146    }
     147
     148    /**
     149     * \brief Cast the vktProp to a vtkImageActor
     150     *
     151     * \return NULL or a vtkImageActor pointer
     152     */
     153    inline vtkImageActor *getImageActor()
     154    {
     155        return vtkImageActor::SafeDownCast(_prop);
    133156    }
    134157
     
    484507                        TRACE("Culling on");
    485508                    }
    486                 }
    487             }
     509                } else if (vtkImageActor::SafeDownCast(prop) != NULL) {
     510                    vtkImageActor::SafeDownCast(prop)->GetProperty()->SetOpacity(opacity);
     511                }
     512            }
     513        } else if (getImageActor() != NULL) {
     514            getImageActor()->GetProperty()->SetOpacity(_opacity);
    488515        }
    489516    }
     
    504531        if (getActor() != NULL) {
    505532            getActor()->GetProperty()->SetAmbient(ambient);
     533        } else if (getImageActor() != NULL) {
     534            getImageActor()->GetProperty()->SetAmbient(ambient);
    506535        } else if (getVolume() != NULL) {
    507536            getVolume()->GetProperty()->SetAmbient(ambient);
     
    513542                if (vtkActor::SafeDownCast(prop) != NULL) {
    514543                    vtkActor::SafeDownCast(prop)->GetProperty()->SetAmbient(ambient);
     544                } else if (vtkImageActor::SafeDownCast(prop) != NULL) {
     545                    vtkImageActor::SafeDownCast(prop)->GetProperty()->SetAmbient(ambient);
    515546                } else if (vtkVolume::SafeDownCast(prop) != NULL) {
    516547                    vtkVolume::SafeDownCast(prop)->GetProperty()->SetAmbient(ambient);
     
    527558        if (getActor() != NULL) {
    528559            getActor()->GetProperty()->SetDiffuse(diffuse);
     560        } else if (getImageActor() != NULL) {
     561            getImageActor()->GetProperty()->SetDiffuse(diffuse);
    529562        } else if (getVolume() != NULL) {
    530563            getVolume()->GetProperty()->SetDiffuse(diffuse);
     
    536569                if (vtkActor::SafeDownCast(prop) != NULL) {
    537570                    vtkActor::SafeDownCast(prop)->GetProperty()->SetDiffuse(diffuse);
     571                } else if (vtkImageActor::SafeDownCast(prop) != NULL) {
     572                    vtkImageActor::SafeDownCast(prop)->GetProperty()->SetDiffuse(diffuse);
    538573                } else if (vtkVolume::SafeDownCast(prop) != NULL) {
    539574                    vtkVolume::SafeDownCast(prop)->GetProperty()->SetDiffuse(diffuse);
     
    581616            property->SetSpecular(specular);
    582617            property->SetSpecularPower(specPower);
     618        } else if (getImageActor() != NULL) {
     619            vtkImageProperty *property = getImageActor()->GetProperty();
     620            property->SetAmbient(ambient);
     621            property->SetDiffuse(diffuse);
    583622        } else if (getVolume() != NULL) {
    584623            vtkVolumeProperty *property = getVolume()->GetProperty();
     
    598637                    property->SetSpecular(specular);
    599638                    property->SetSpecularPower(specPower);
     639                } else if (vtkImageActor::SafeDownCast(prop) != NULL) {
     640                    vtkImageProperty *property = vtkImageActor::SafeDownCast(prop)->GetProperty();
     641                    property->SetAmbient(ambient);
     642                    property->SetDiffuse(diffuse);
    600643                } else if (vtkVolume::SafeDownCast(prop) != NULL) {
    601644                    vtkVolumeProperty *property = vtkVolume::SafeDownCast(prop)->GetProperty();
Note: See TracChangeset for help on using the changeset viewer.