Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef SMESH_DEVICE_ACTOR_H
00030 #define SMESH_DEVICE_ACTOR_H
00031
00032 #include <VTKViewer_GeometryFilter.h>
00033 #include <VTKViewer_MarkerDef.h>
00034 #include "SMESH_Controls.hxx"
00035 #include "SMESH_Object.h"
00036
00037 #include <vtkLODActor.h>
00038 #include <vtkSmartPointer.h>
00039
00040 class vtkCell;
00041 class vtkProperty;
00042 class vtkMergeFilter;
00043 class vtkShrinkFilter;
00044 class vtkUnstructuredGrid;
00045 class vtkLookupTable;
00046 class vtkImplicitBoolean;
00047 class vtkPassThroughFilter;
00048
00049 class VTKViewer_Transform;
00050 class VTKViewer_TransformFilter;
00051 class VTKViewer_ExtractUnstructuredGrid;
00052 class VTKViewer_PolyDataMapper;
00053
00054 class SMESH_ExtractGeometry;
00055 class SMESH_FaceOrientationFilter;
00056 class SMESH_ScalarBarActor;
00057
00058
00059 class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
00060 friend class SMESH_ActorDef;
00061
00062 public:
00063 vtkTypeMacro(SMESH_DeviceActor,vtkLODActor);
00064 static SMESH_DeviceActor* New();
00065
00066 void SetStoreClippingMapping(bool theStoreMapping);
00067 void SetStoreGemetryMapping(bool theStoreMapping);
00068 void SetStoreIDMapping(bool theStoreMapping);
00069
00070 virtual int GetNodeObjId(int theVtkID);
00071 virtual vtkFloatingPointType* GetNodeCoord(int theObjID);
00072
00073 virtual int GetElemObjId(int theVtkID);
00074 virtual vtkCell* GetElemCell(int theObjID);
00075
00076 virtual void SetTransform(VTKViewer_Transform* theTransform);
00077 virtual unsigned long int GetMTime();
00078
00079 virtual void SetFacesOriented(bool theIsFacesOriented);
00080 virtual bool GetFacesOriented() { return myIsFacesOriented; }
00081
00082 virtual void SetFacesOrientationColor(vtkFloatingPointType theColor[3]);
00083 virtual void GetFacesOrientationColor(vtkFloatingPointType theColor[3]);
00084
00085 virtual void SetFacesOrientationScale(vtkFloatingPointType theScale);
00086 virtual vtkFloatingPointType GetFacesOrientationScale();
00087
00088 virtual void SetFacesOrientation3DVectors(bool theState);
00089 virtual bool GetFacesOrientation3DVectors();
00090
00091
00093 virtual void SetQuadraticArcMode(bool theFlag);
00094 virtual bool GetQuadraticArcMode();
00095
00096 virtual void SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
00097 virtual vtkFloatingPointType GetQuadraticArcAngle();
00098
00099 void UpdateFaceOrientation();
00100
00101 vtkFloatingPointType GetShrinkFactor();
00102 void SetShrinkFactor(vtkFloatingPointType value);
00103
00104 bool IsShrunkable() { return myIsShrinkable;}
00105 bool IsShrunk() { return myIsShrunk;}
00106 void SetShrink();
00107 void UnShrink();
00108
00109 enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe};
00110 EReperesent GetRepresentation(){ return myRepresentation;}
00111 void SetRepresentation(EReperesent theMode);
00112
00113 virtual void SetVisibility(int theMode);
00114 virtual int GetVisibility();
00115
00116 virtual void AddToRender(vtkRenderer* theRenderer);
00117 virtual void RemoveFromRender(vtkRenderer* theRenderer);
00118
00119 VTKViewer_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
00120 vtkUnstructuredGrid* GetUnstructuredGrid();
00121
00122 void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
00123 SMESH_ScalarBarActor* theScalarBarActor,
00124 vtkLookupTable* theLookupTable);
00125 void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
00126 SMESH_ScalarBarActor* theScalarBarActor,
00127 vtkLookupTable* theLookupTable);
00128 void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor);
00129
00130 bool IsHighlited() { return myIsHighlited;}
00131 void SetHighlited(bool theIsHighlited);
00132
00133 virtual void Render(vtkRenderer *, vtkMapper *);
00134
00135 void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
00136 bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
00137
00138 void SetMarkerEnabled( bool );
00139 void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
00140 void SetMarkerTexture( int, VTK::MarkerTexture );
00141 VTK::MarkerType GetMarkerType();
00142 VTK::MarkerScale GetMarkerScale();
00143 int GetMarkerTexture();
00144
00145 protected:
00146 void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
00147 void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
00148
00149 VTKViewer_PolyDataMapper *myMapper;
00150 TVisualObjPtr myVisualObj;
00151
00152 vtkProperty *myProperty;
00153 EReperesent myRepresentation;
00154
00155 SMESH_ExtractGeometry* myExtractGeometry;
00156 bool myIsImplicitFunctionUsed;
00157
00158 vtkMergeFilter* myMergeFilter;
00159 VTKViewer_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
00160
00161 bool myIsFacesOriented;
00162 SMESH_FaceOrientationFilter* myFaceOrientationFilter;
00163 vtkPolyDataMapper* myFaceOrientationDataMapper;
00164 vtkActor* myFaceOrientation;
00165
00166 bool myStoreClippingMapping;
00167 VTKViewer_GeometryFilter *myGeomFilter;
00168 VTKViewer_TransformFilter *myTransformFilter;
00169 std::vector<vtkPassThroughFilter*> myPassFilter;
00170
00171 vtkShrinkFilter* myShrinkFilter;
00172 bool myIsShrinkable;
00173 bool myIsShrunk;
00174
00175 bool myIsHighlited;
00176
00177 vtkFloatingPointType myPolygonOffsetFactor;
00178 vtkFloatingPointType myPolygonOffsetUnits;
00179
00180 void
00181 SetPolygonOffsetParameters(vtkFloatingPointType factor,
00182 vtkFloatingPointType units);
00183
00184 void
00185 GetPolygonOffsetParameters(vtkFloatingPointType& factor,
00186 vtkFloatingPointType& units)
00187 {
00188 factor = myPolygonOffsetFactor;
00189 units = myPolygonOffsetUnits;
00190 }
00191
00192 SMESH_DeviceActor();
00193 ~SMESH_DeviceActor();
00194 SMESH_DeviceActor(const SMESH_DeviceActor&);
00195 void operator=(const SMESH_DeviceActor&);
00196
00197 };
00198
00199
00200 #endif //SMESH_DEVICE_ACTOR_H