@COMMENCE@
-EXPORT_HEADERS = SMESH_Actor.h SMESH_Object.h SMESH_ActorUtils.h
+EXPORT_HEADERS = SMESH_Actor.h SMESH_ActorDef.h SMESH_Object.h SMESH_ActorUtils.h
# Libraries targets
// $Header$
-#include "SMESH_Actor.h"
+#include "SMESH_ActorDef.h"
#include "SMESH_ActorUtils.h"
#include "SMESH_DeviceActor.h"
#include "SMESH_ControlsDef.hxx"
static int aPointSizeInc = 2;
-SMESH_Actor* SMESH_Actor::New(){
- return new SMESH_Actor();
+SMESH_ActorDef* SMESH_ActorDef::New(){
+ return new SMESH_ActorDef();
}
const char* theName,
int theIsClear)
{
- SMESH_Actor* anActor = SMESH_Actor::New();
+ SMESH_ActorDef* anActor = SMESH_ActorDef::New();
if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){
anActor->Delete();
anActor = NULL;
}
-SMESH_Actor::SMESH_Actor(){
- if(MYDEBUG) MESSAGE("SMESH_Actor");
+SMESH_ActorDef::SMESH_ActorDef(){
+ if(MYDEBUG) MESSAGE("SMESH_ActorDef");
myTimeStamp = vtkTimeStamp::New();
}
-SMESH_Actor::~SMESH_Actor(){
- if(MYDEBUG) MESSAGE("~SMESH_Actor");
+SMESH_ActorDef::~SMESH_ActorDef(){
+ if(MYDEBUG) MESSAGE("~SMESH_ActorDef");
myScalarBarActor->Delete();
myLookupTable->Delete();
}
-void SMESH_Actor::SetPointsLabeled( bool theIsPointsLabeled )
+void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
{
vtkUnstructuredGrid* aGrid = GetUnstructuredGrid();
myIsPointsLabeled = theIsPointsLabeled && aGrid->GetNumberOfPoints();
}
-void SMESH_Actor::SetCellsLabeled(bool theIsCellsLabeled){
+void SMESH_ActorDef::SetCellsLabeled(bool theIsCellsLabeled){
vtkUnstructuredGrid* aGrid = GetUnstructuredGrid();
myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
if(myIsCellsLabeled){
}
-void SMESH_Actor::SetControlMode(eControl theMode){
+void SMESH_ActorDef::SetControlMode(eControl theMode){
myControlMode = eNone;
my1DColorMode = e1DNone;
}
-void SMESH_Actor::AddToRender(vtkRenderer* theRenderer){
+void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
SALOME_Actor::AddToRender(theRenderer);
theRenderer->AddActor(myNodeActor);
theRenderer->AddActor2D(myCellsLabels);
}
-void SMESH_Actor::RemoveFromRender(vtkRenderer* theRenderer){
+void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
SALOME_Actor::RemoveFromRender(theRenderer);
theRenderer->RemoveActor(myNodeActor);
}
-bool SMESH_Actor::Init(TVisualObjPtr theVisualObj,
+bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
const char* theEntry,
const char* theName,
int theIsClear)
}
-float* SMESH_Actor::GetBounds(){
+float* SMESH_ActorDef::GetBounds(){
return myNodeActor->GetBounds();
}
-vtkDataSet* SMESH_Actor::GetInput(){
+vtkDataSet* SMESH_ActorDef::GetInput(){
return GetUnstructuredGrid();
}
-void SMESH_Actor::SetTransform(SALOME_Transform* theTransform){
+void SMESH_ActorDef::SetTransform(SALOME_Transform* theTransform){
myNodeActor->SetTransform(theTransform);
myBaseActor->SetTransform(theTransform);
}
-void SMESH_Actor::SetMapper(vtkMapper* theMapper){
+void SMESH_ActorDef::SetMapper(vtkMapper* theMapper){
vtkLODActor::SetMapper(theMapper);
}
-void SMESH_Actor::ShallowCopy(vtkProp *prop){
+void SMESH_ActorDef::ShallowCopy(vtkProp *prop){
SALOME_Actor::ShallowCopy(prop);
}
-vtkMapper* SMESH_Actor::GetMapper(){
+vtkMapper* SMESH_ActorDef::GetMapper(){
return myPickableActor->GetMapper();
}
-vtkUnstructuredGrid* SMESH_Actor::GetUnstructuredGrid(){
+vtkUnstructuredGrid* SMESH_ActorDef::GetUnstructuredGrid(){
return myVisualObj->GetUnstructuredGrid();
}
-bool SMESH_Actor::IsInfinitive(){
+bool SMESH_ActorDef::IsInfinitive(){
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
aDataSet->Update();
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
}
-void SMESH_Actor::SetIsShrunkable(bool theShrunkable){
+void SMESH_ActorDef::SetIsShrunkable(bool theShrunkable){
myIsShrinkable = theShrunkable;
Modified();
}
-float SMESH_Actor::GetShrinkFactor(){
+float SMESH_ActorDef::GetShrinkFactor(){
return myBaseActor->GetShrinkFactor();
}
-void SMESH_Actor::SetShrinkFactor(float theValue){
+void SMESH_ActorDef::SetShrinkFactor(float theValue){
myBaseActor->SetShrinkFactor(theValue);
my1DActor->SetShrinkFactor(theValue);
Modified();
}
-void SMESH_Actor::SetShrink(){
+void SMESH_ActorDef::SetShrink(){
if(!myIsShrinkable) return;
myBaseActor->SetShrink();
Modified();
}
-void SMESH_Actor::UnShrink(){
+void SMESH_ActorDef::UnShrink(){
if(!myIsShrunk) return;
myBaseActor->UnShrink();
}
-int SMESH_Actor::GetNodeObjId(int theVtkID){
+int SMESH_ActorDef::GetNodeObjId(int theVtkID){
return myPickableActor->GetNodeObjId(theVtkID);
}
-float* SMESH_Actor::GetNodeCoord(int theObjID){
+float* SMESH_ActorDef::GetNodeCoord(int theObjID){
return myPickableActor->GetNodeCoord(theObjID);
}
-int SMESH_Actor::GetElemObjId(int theVtkID){
+int SMESH_ActorDef::GetElemObjId(int theVtkID){
return myPickableActor->GetElemObjId(theVtkID);
}
-vtkCell* SMESH_Actor::GetElemCell(int theObjID){
+vtkCell* SMESH_ActorDef::GetElemCell(int theObjID){
return myPickableActor->GetElemCell(theObjID);
}
-void SMESH_Actor::SetVisibility(int theMode){
+void SMESH_ActorDef::SetVisibility(int theMode){
SetVisibility(theMode,true);
}
-void SMESH_Actor::SetVisibility(int theMode, bool theIsUpdateRepersentation){
+void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
SALOME_Actor::SetVisibility(theMode);
if(GetVisibility()){
if(theIsUpdateRepersentation)
}
-void SMESH_Actor::SetEntityMode(unsigned int theMode){
+void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
if(!myVisualObj->GetNbEntities(SMESH::EDGE))
theMode &= ~eEdges;
myEntityMode = theMode;
}
-void SMESH_Actor::SetRepresentation(int theMode){
+void SMESH_ActorDef::SetRepresentation(int theMode){
int aNbEdges = myVisualObj->GetNbEntities(SMESH::EDGE);
int aNbFaces = myVisualObj->GetNbEntities(SMESH::FACE);
int aNbVolumes = myVisualObj->GetNbEntities(SMESH::VOLUME);
}
-void SMESH_Actor::SetPointRepresentation(bool theIsPointsVisible){
+void SMESH_ActorDef::SetPointRepresentation(bool theIsPointsVisible){
myIsPointsVisible = theIsPointsVisible;
SetRepresentation(GetRepresentation());
}
-bool SMESH_Actor::GetPointRepresentation(){
+bool SMESH_ActorDef::GetPointRepresentation(){
return myIsPointsVisible || myIsPointsLabeled;
}
-void SMESH_Actor::UpdateHighlight(){
+void SMESH_ActorDef::UpdateHighlight(){
myHighlitableActor->SetVisibility(false);
myHighlitableActor->SetHighlited(false);
}
-void SMESH_Actor::highlight(bool theHighlight){
+void SMESH_ActorDef::highlight(bool theHighlight){
myIsHighlighted = theHighlight;
UpdateHighlight();
}
-void SMESH_Actor::SetPreSelected(bool thePreselect){
+void SMESH_ActorDef::SetPreSelected(bool thePreselect){
myIsPreselected = thePreselect;
UpdateHighlight();
}
// From vtkFollower
-int SMESH_Actor::RenderOpaqueGeometry(vtkViewport *vp)
+int SMESH_ActorDef::RenderOpaqueGeometry(vtkViewport *vp)
{
if (myPickableActor->GetIsOpaque())
{
}
-int SMESH_Actor::RenderTranslucentGeometry(vtkViewport *vp)
+int SMESH_ActorDef::RenderTranslucentGeometry(vtkViewport *vp)
{
if (!myPickableActor->GetIsOpaque())
{
}
-void SMESH_Actor::Render(vtkRenderer *ren){
+void SMESH_ActorDef::Render(vtkRenderer *ren){
unsigned long mTime = myTimeStamp->GetMTime();
unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
if(anObjTime > mTime)
}
-void SMESH_Actor::Update(){
+void SMESH_ActorDef::Update(){
SetVisibility(GetVisibility());
unsigned long int anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
unsigned long int aClippingTime = myImplicitBoolean->GetMTime();
unsigned long int aTime = myTimeStamp->GetMTime();
- if(MYDEBUG) MESSAGE("SMESH_Actor::Update");
+ if(MYDEBUG) MESSAGE("SMESH_ActorDef::Update");
if(GetControlMode() != eNone) {
if(anObjTime > aTime || aClippingTime > aTime){
}
-void SMESH_Actor::ReleaseGraphicsResources(vtkWindow *renWin){
+void SMESH_ActorDef::ReleaseGraphicsResources(vtkWindow *renWin){
SALOME_Actor::ReleaseGraphicsResources(renWin);
myPickableActor->ReleaseGraphicsResources(renWin);
}
-void SMESH_Actor::SetOpacity(float theValue){
+void SMESH_ActorDef::SetOpacity(float theValue){
mySurfaceProp->SetOpacity(theValue);
myBackSurfaceProp->SetOpacity(theValue);
myEdgeProp->SetOpacity(theValue);
}
-float SMESH_Actor::GetOpacity(){
+float SMESH_ActorDef::GetOpacity(){
return mySurfaceProp->GetOpacity();
}
-void SMESH_Actor::SetSufaceColor(float r,float g,float b){
+void SMESH_ActorDef::SetSufaceColor(float r,float g,float b){
mySurfaceProp->SetColor(r,g,b);
Modified();
}
-void SMESH_Actor::GetSufaceColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetSufaceColor(float& r,float& g,float& b){
::GetColor(mySurfaceProp,r,g,b);
}
-void SMESH_Actor::SetBackSufaceColor(float r,float g,float b){
+void SMESH_ActorDef::SetBackSufaceColor(float r,float g,float b){
myBackSurfaceProp->SetColor(r,g,b);
Modified();
}
-void SMESH_Actor::GetBackSufaceColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetBackSufaceColor(float& r,float& g,float& b){
::GetColor(myBackSurfaceProp,r,g,b);
}
-void SMESH_Actor::SetEdgeColor(float r,float g,float b){
+void SMESH_ActorDef::SetEdgeColor(float r,float g,float b){
myEdgeProp->SetColor(r,g,b);
my1DProp->SetColor(r,g,b);
my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
Modified();
}
-void SMESH_Actor::GetEdgeColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetEdgeColor(float& r,float& g,float& b){
::GetColor(myEdgeProp,r,g,b);
}
-void SMESH_Actor::SetNodeColor(float r,float g,float b){
+void SMESH_ActorDef::SetNodeColor(float r,float g,float b){
myNodeProp->SetColor(r,g,b);
Modified();
}
-void SMESH_Actor::GetNodeColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetNodeColor(float& r,float& g,float& b){
::GetColor(myNodeProp,r,g,b);
}
-void SMESH_Actor::SetHighlightColor(float r,float g,float b){
+void SMESH_ActorDef::SetHighlightColor(float r,float g,float b){
myHighlightProp->SetColor(r,g,b);
Modified();
}
-void SMESH_Actor::GetHighlightColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetHighlightColor(float& r,float& g,float& b){
::GetColor(myHighlightProp,r,g,b);
}
-void SMESH_Actor::SetPreHighlightColor(float r,float g,float b){
+void SMESH_ActorDef::SetPreHighlightColor(float r,float g,float b){
myPreselectProp->SetColor(r,g,b);
Modified();
}
-void SMESH_Actor::GetPreHighlightColor(float& r,float& g,float& b){
+void SMESH_ActorDef::GetPreHighlightColor(float& r,float& g,float& b){
::GetColor(myPreselectProp,r,g,b);
}
-float SMESH_Actor::GetLineWidth(){
+float SMESH_ActorDef::GetLineWidth(){
return myEdgeProp->GetLineWidth();
}
-void SMESH_Actor::SetLineWidth(float theVal){
+void SMESH_ActorDef::SetLineWidth(float theVal){
myEdgeProp->SetLineWidth(theVal);
my1DProp->SetLineWidth(theVal + aLineWidthInc);
}
-void SMESH_Actor::SetNodeSize(float theVal){
+void SMESH_ActorDef::SetNodeSize(float theVal){
myNodeProp->SetPointSize(theVal);
myHighlightProp->SetPointSize(theVal);
myPreselectProp->SetPointSize(theVal);
Modified();
}
-float SMESH_Actor::GetNodeSize(){
+float SMESH_ActorDef::GetNodeSize(){
return myNodeProp->GetPointSize();
}
-int SMESH_Actor::GetObjDimension( const int theObjId )
+int SMESH_ActorDef::GetObjDimension( const int theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
}
-vtkImplicitBoolean* SMESH_Actor::GetPlaneContainer(){
+vtkImplicitBoolean* SMESH_ActorDef::GetPlaneContainer(){
return myImplicitBoolean;
}
}
-void SMESH_Actor::SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane)
+void SMESH_ActorDef::SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane)
{
thePlane->SetNormal(theDir);
float anOrigin[3];
}
-void SMESH_Actor::GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane)
+void SMESH_ActorDef::GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane)
{
thePlane->GetNormal(theDir);
#include "SALOME_Actor.h"
#include "SMESH_Object.h"
-class vtkProperty;
-class vtkShrinkFilter;
-class vtkPolyDataMapper;
class vtkUnstructuredGrid;
-class vtkMergeFilter;
-class vtkPolyData;
-
-class vtkMapper;
-class vtkActor2D;
-class vtkMaskPoints;
-class vtkCellCenters;
-class vtkLabeledDataMapper;
-class vtkSelectVisiblePoints;
class vtkScalarBarActor;
-class vtkLookupTable;
class vtkPlane;
class vtkImplicitBoolean;
-class vtkTimeStamp;
-
-class SMESH_DeviceActor;
-
-
-class SMESH_Actor : public SALOME_Actor{
- friend class SMESH_VisualObj;
+class SMESH_Actor: public SALOME_Actor
+{
+ static SMESH_Actor* New() { return NULL;}
public:
vtkTypeMacro(SMESH_Actor,SALOME_Actor);
const char* theName,
int theIsClear);
- virtual void ReleaseGraphicsResources(vtkWindow *renWin);
- virtual int RenderOpaqueGeometry(vtkViewport *viewport);
- virtual int RenderTranslucentGeometry(vtkViewport *viewport);
- virtual void Render(vtkRenderer *ren);
-
- virtual void AddToRender(vtkRenderer* theRenderer);
- virtual void RemoveFromRender(vtkRenderer* theRenderer);
-
- virtual bool hasHighlight() { return true; }
- virtual void highlight(bool theHighlight);
- virtual void SetPreSelected(bool thePreselect = false);
-
- virtual bool IsInfinitive();
-
- virtual void SetOpacity(float theValue);
- virtual float GetOpacity();
-
- void SetSufaceColor(float r,float g,float b);
- void GetSufaceColor(float& r,float& g,float& b);
-
- void SetBackSufaceColor(float r,float g,float b);
- void GetBackSufaceColor(float& r,float& g,float& b);
-
- void SetEdgeColor(float r,float g,float b);
- void GetEdgeColor(float& r,float& g,float& b);
+ virtual void SetSufaceColor(float r,float g,float b) = 0;
+ virtual void GetSufaceColor(float& r,float& g,float& b) = 0;
+
+ virtual void SetBackSufaceColor(float r,float g,float b) = 0;
+ virtual void GetBackSufaceColor(float& r,float& g,float& b) = 0;
+
+ virtual void SetEdgeColor(float r,float g,float b) = 0;
+ virtual void GetEdgeColor(float& r,float& g,float& b) = 0;
- void SetNodeColor(float r,float g,float b);
- void GetNodeColor(float& r,float& g,float& b);
+ virtual void SetNodeColor(float r,float g,float b) = 0;
+ virtual void GetNodeColor(float& r,float& g,float& b) = 0;
- void SetHighlightColor(float r,float g,float b);
- void GetHighlightColor(float& r,float& g,float& b);
+ virtual void SetHighlightColor(float r,float g,float b) = 0;
+ virtual void GetHighlightColor(float& r,float& g,float& b) = 0;
- void SetPreHighlightColor(float r,float g,float b);
- void GetPreHighlightColor(float& r,float& g,float& b);
+ virtual void SetPreHighlightColor(float r,float g,float b) = 0;
+ virtual void GetPreHighlightColor(float& r,float& g,float& b) = 0;
- float GetLineWidth();
- void SetLineWidth(float theVal);
-
- void SetNodeSize(float size) ;
- float GetNodeSize() ;
-
- virtual int GetNodeObjId(int theVtkID);
- virtual float* GetNodeCoord(int theObjID);
+ virtual float GetLineWidth() = 0;
+ virtual void SetLineWidth(float theVal) = 0;
- virtual int GetElemObjId(int theVtkID);
- virtual vtkCell* GetElemCell(int theObjID);
-
- virtual int GetObjDimension( const int theObjId );
-
- virtual void SetVisibility(int theMode);
- void SetVisibility(int theMode, bool theIsUpdateRepersentation);
+ virtual void SetNodeSize(float size) = 0;
+ virtual float GetNodeSize() = 0;
enum EReperesent { ePoint, eEdge, eSurface};
- virtual void SetRepresentation(int theMode);
enum EEntityMode { eEdges = 0x01, eFaces = 0x02, eVolumes = 0x04, eAllEntity = 0x07};
- unsigned int GetEntityMode() const { return myEntityMode;}
- void SetEntityMode(unsigned int theMode);
-
- void SetPointRepresentation(bool theIsPointsVisible);
- bool GetPointRepresentation();
-
- virtual float* GetBounds();
- virtual void SetTransform(SALOME_Transform* theTransform);
+ virtual void SetEntityMode(unsigned int theMode) = 0;
+ virtual unsigned int GetEntityMode() const = 0;
- vtkUnstructuredGrid* GetUnstructuredGrid();
- virtual vtkDataSet* GetInput();
- virtual vtkMapper* GetMapper();
+ virtual void SetPointRepresentation(bool theIsPointsVisible) = 0;
+ virtual bool GetPointRepresentation() = 0;
- virtual float GetShrinkFactor();
- virtual void SetShrinkFactor(float value );
+ virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
- virtual bool IsShrunkable() { return myIsShrinkable;}
- virtual bool IsShrunk() { return myIsShrunk;}
- virtual void SetShrink();
- virtual void UnShrink();
+ virtual void SetShrinkFactor(float theValue) = 0;
- void SetPointsLabeled(bool theIsPointsLabeled);
- bool GetPointsLabeled(){ return myIsPointsLabeled;}
+ virtual void SetPointsLabeled(bool theIsPointsLabeled) = 0;
+ virtual bool GetPointsLabeled() = 0;
- void SetCellsLabeled(bool theIsCellsLabeled);
- bool GetCellsLabeled(){ return myIsCellsLabeled;}
+ virtual void SetCellsLabeled(bool theIsCellsLabeled) = 0;
+ virtual bool GetCellsLabeled() = 0;
enum eControl{eNone, eLengthEdges, eLength, eFreeBorders, eFreeEdges, eMultiConnection,
eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew,
eAspectRatio3D};
- void SetControlMode(eControl theMode);
- eControl GetControlMode(){ return myControlMode;}
-
- enum e1DControl{e1DNone, e1DColored, e1DHighlited};
- e1DControl Get1DControlMode(){ return my1DColorMode;}
-
- vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;}
-
- void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
- void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane);
-
- vtkImplicitBoolean* GetPlaneContainer();
-
- TVisualObjPtr GetObject() { return myVisualObj;}
-
- void SetControlsPrecision( const long p ) { myControlsPrecision = p; }
- long GetControlsPrecision() const { return myControlsPrecision; }
-
- protected:
- TVisualObjPtr myVisualObj;
- vtkTimeStamp* myTimeStamp;
-
- vtkScalarBarActor* myScalarBarActor;
- vtkLookupTable* myLookupTable;
-
- vtkProperty* mySurfaceProp;
- vtkProperty* myBackSurfaceProp;
- vtkProperty* myEdgeProp;
- vtkProperty* myNodeProp;
-
- SMESH_DeviceActor* myBaseActor;
- SMESH_DeviceActor* myNodeActor;
- SMESH_DeviceActor* myPickableActor;
-
- vtkProperty* myHighlightProp;
- vtkProperty* myPreselectProp;
- SMESH_DeviceActor* myHighlitableActor;
- SMESH_DeviceActor* myNodeHighlitableActor;
-
- eControl myControlMode;
- SMESH_DeviceActor* my2DActor;
- SMESH_DeviceActor* my3DActor;
- SMESH_DeviceActor* myControlActor;
-
- e1DControl my1DColorMode;
- vtkProperty* my1DProp;
- SMESH_DeviceActor* my1DActor;
- vtkProperty* my1DExtProp;
- SMESH_DeviceActor* my1DExtActor;
-
- unsigned int myEntityMode;
- bool myIsPointsVisible;
-
- bool myIsShrinkable;
- bool myIsShrunk;
-
- bool myIsPointsLabeled;
- vtkUnstructuredGrid* myPointsNumDataSet;
- vtkActor2D *myPointLabels;
- vtkMaskPoints* myPtsMaskPoints;
- vtkLabeledDataMapper* myPtsLabeledDataMapper;
- vtkSelectVisiblePoints* myPtsSelectVisiblePoints;
-
- bool myIsCellsLabeled;
- vtkUnstructuredGrid* myCellsNumDataSet;
- vtkActor2D *myCellsLabels;
- vtkMaskPoints* myClsMaskPoints;
- vtkCellCenters* myCellCenters;
- vtkLabeledDataMapper* myClsLabeledDataMapper;
- vtkSelectVisiblePoints* myClsSelectVisiblePoints;
-
- vtkImplicitBoolean* myImplicitBoolean;
-
- long myControlsPrecision;
+ virtual void SetControlMode(eControl theMode) = 0;
+ virtual eControl GetControlMode() = 0;
- SMESH_Actor();
- ~SMESH_Actor();
+ virtual vtkScalarBarActor* GetScalarBarActor() = 0;
- bool Init(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear);
+ virtual void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane) = 0;
+ virtual void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane) = 0;
- void SetIsShrunkable(bool theShrunkable);
- void UpdateHighlight();
- void Update();
+ virtual vtkImplicitBoolean* GetPlaneContainer() = 0;
- private:
- // hide the two parameter Render() method from the user and the compiler.
- virtual void Render(vtkRenderer *, vtkMapper *) {};
- virtual void ShallowCopy(vtkProp *prop);
- virtual void SetMapper(vtkMapper *);
- static SMESH_Actor* New();
+ virtual TVisualObjPtr GetObject() = 0;
- // Not implemented.
- SMESH_Actor(const SMESH_Actor&);
- void operator=(const SMESH_Actor&);
+ virtual void SetControlsPrecision( const long ) = 0;
+ virtual long GetControlsPrecision() const = 0;
};
--- /dev/null
+// SMESH OBJECT : interactive object for SMESH visualization
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SMESH_ActorDef.h
+// Author : Nicolas REJNERI
+// Module : SMESH
+// $Header$
+
+#ifndef SMESH_ACTORDEF_H
+#define SMESH_ACTORDEF_H
+
+#include "SMESH_Actor.h"
+#include "SMESH_Object.h"
+
+class vtkProperty;
+class vtkShrinkFilter;
+class vtkPolyDataMapper;
+class vtkUnstructuredGrid;
+class vtkMergeFilter;
+class vtkPolyData;
+
+class vtkMapper;
+class vtkActor2D;
+class vtkMaskPoints;
+class vtkCellCenters;
+class vtkLabeledDataMapper;
+class vtkSelectVisiblePoints;
+
+class vtkScalarBarActor;
+class vtkLookupTable;
+
+class vtkPlane;
+class vtkImplicitBoolean;
+
+class vtkTimeStamp;
+
+class SMESH_DeviceActor;
+
+
+class SMESH_ActorDef : public SMESH_Actor{
+ friend class SMESH_VisualObj;
+ friend class SMESH_Actor;
+
+ public:
+ vtkTypeMacro(SMESH_ActorDef,SMESH_Actor);
+
+ virtual void ReleaseGraphicsResources(vtkWindow *renWin);
+ virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+ virtual int RenderTranslucentGeometry(vtkViewport *viewport);
+ virtual void Render(vtkRenderer *ren);
+
+ virtual void AddToRender(vtkRenderer* theRenderer);
+ virtual void RemoveFromRender(vtkRenderer* theRenderer);
+
+ virtual bool hasHighlight() { return true; }
+ virtual void highlight(bool theHighlight);
+ virtual void SetPreSelected(bool thePreselect = false);
+
+ virtual bool IsInfinitive();
+
+ virtual void SetOpacity(float theValue);
+ virtual float GetOpacity();
+
+ virtual void SetSufaceColor(float r,float g,float b);
+ virtual void GetSufaceColor(float& r,float& g,float& b);
+
+ virtual void SetBackSufaceColor(float r,float g,float b);
+ virtual void GetBackSufaceColor(float& r,float& g,float& b);
+
+ virtual void SetEdgeColor(float r,float g,float b);
+ virtual void GetEdgeColor(float& r,float& g,float& b);
+
+ virtual void SetNodeColor(float r,float g,float b);
+ virtual void GetNodeColor(float& r,float& g,float& b);
+
+ virtual void SetHighlightColor(float r,float g,float b);
+ virtual void GetHighlightColor(float& r,float& g,float& b);
+
+ virtual void SetPreHighlightColor(float r,float g,float b);
+ virtual void GetPreHighlightColor(float& r,float& g,float& b);
+
+ virtual float GetLineWidth();
+ virtual void SetLineWidth(float theVal);
+
+ virtual void SetNodeSize(float size) ;
+ virtual float GetNodeSize() ;
+
+ virtual int GetNodeObjId(int theVtkID);
+ virtual float* GetNodeCoord(int theObjID);
+
+ virtual int GetElemObjId(int theVtkID);
+ virtual vtkCell* GetElemCell(int theObjID);
+
+ virtual int GetObjDimension( const int theObjId );
+
+ virtual void SetVisibility(int theMode);
+ void SetVisibility(int theMode, bool theIsUpdateRepersentation);
+
+ virtual void SetRepresentation(int theMode);
+
+ virtual unsigned int GetEntityMode() const { return myEntityMode;}
+ virtual void SetEntityMode(unsigned int theMode);
+
+ virtual void SetPointRepresentation(bool theIsPointsVisible);
+ virtual bool GetPointRepresentation();
+
+ virtual float* GetBounds();
+ virtual void SetTransform(SALOME_Transform* theTransform);
+
+ virtual vtkUnstructuredGrid* GetUnstructuredGrid();
+ virtual vtkDataSet* GetInput();
+ virtual vtkMapper* GetMapper();
+
+ virtual float GetShrinkFactor();
+ virtual void SetShrinkFactor(float theValue);
+
+ virtual bool IsShrunkable() { return myIsShrinkable;}
+ virtual bool IsShrunk() { return myIsShrunk;}
+ virtual void SetShrink();
+ virtual void UnShrink();
+
+ virtual void SetPointsLabeled(bool theIsPointsLabeled);
+ virtual bool GetPointsLabeled(){ return myIsPointsLabeled;}
+
+ virtual void SetCellsLabeled(bool theIsCellsLabeled);
+ virtual bool GetCellsLabeled(){ return myIsCellsLabeled;}
+
+ virtual void SetControlMode(eControl theMode);
+ virtual eControl GetControlMode(){ return myControlMode;}
+
+ enum e1DControl{e1DNone, e1DColored, e1DHighlited};
+ e1DControl Get1DControlMode(){ return my1DColorMode;}
+
+ virtual vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;}
+
+ virtual void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
+ virtual void GetPlaneParam(float theDir[3], float& theDist, vtkPlane* thePlane);
+
+ virtual vtkImplicitBoolean* GetPlaneContainer();
+
+ virtual TVisualObjPtr GetObject() { return myVisualObj;}
+
+ virtual void SetControlsPrecision( const long p ) { myControlsPrecision = p; }
+ virtual long GetControlsPrecision() const { return myControlsPrecision; }
+
+ protected:
+ TVisualObjPtr myVisualObj;
+ vtkTimeStamp* myTimeStamp;
+
+ vtkScalarBarActor* myScalarBarActor;
+ vtkLookupTable* myLookupTable;
+
+ vtkProperty* mySurfaceProp;
+ vtkProperty* myBackSurfaceProp;
+ vtkProperty* myEdgeProp;
+ vtkProperty* myNodeProp;
+
+ SMESH_DeviceActor* myBaseActor;
+ SMESH_DeviceActor* myNodeActor;
+ SMESH_DeviceActor* myPickableActor;
+
+ vtkProperty* myHighlightProp;
+ vtkProperty* myPreselectProp;
+ SMESH_DeviceActor* myHighlitableActor;
+ SMESH_DeviceActor* myNodeHighlitableActor;
+
+ eControl myControlMode;
+ SMESH_DeviceActor* my2DActor;
+ SMESH_DeviceActor* my3DActor;
+ SMESH_DeviceActor* myControlActor;
+
+ e1DControl my1DColorMode;
+ vtkProperty* my1DProp;
+ SMESH_DeviceActor* my1DActor;
+ vtkProperty* my1DExtProp;
+ SMESH_DeviceActor* my1DExtActor;
+
+ unsigned int myEntityMode;
+ bool myIsPointsVisible;
+
+ bool myIsShrinkable;
+ bool myIsShrunk;
+
+ bool myIsPointsLabeled;
+ vtkUnstructuredGrid* myPointsNumDataSet;
+ vtkActor2D *myPointLabels;
+ vtkMaskPoints* myPtsMaskPoints;
+ vtkLabeledDataMapper* myPtsLabeledDataMapper;
+ vtkSelectVisiblePoints* myPtsSelectVisiblePoints;
+
+ bool myIsCellsLabeled;
+ vtkUnstructuredGrid* myCellsNumDataSet;
+ vtkActor2D *myCellsLabels;
+ vtkMaskPoints* myClsMaskPoints;
+ vtkCellCenters* myCellCenters;
+ vtkLabeledDataMapper* myClsLabeledDataMapper;
+ vtkSelectVisiblePoints* myClsSelectVisiblePoints;
+
+ vtkImplicitBoolean* myImplicitBoolean;
+
+ long myControlsPrecision;
+
+ SMESH_ActorDef();
+ ~SMESH_ActorDef();
+
+ bool Init(TVisualObjPtr theVisualObj,
+ const char* theEntry,
+ const char* theName,
+ int theIsClear);
+
+ void SetIsShrunkable(bool theShrunkable);
+ void UpdateHighlight();
+ void Update();
+
+ private:
+ // hide the two parameter Render() method from the user and the compiler.
+ virtual void Render(vtkRenderer *, vtkMapper *) {};
+ virtual void ShallowCopy(vtkProp *prop);
+ virtual void SetMapper(vtkMapper *);
+ static SMESH_ActorDef* New();
+
+ // Not implemented.
+ SMESH_ActorDef(const SMESH_ActorDef&);
+ void operator=(const SMESH_ActorDef&);
+};
+
+
+#endif //SMESH_ACTORDEF_H
class SMESH_DeviceActor: public vtkLODActor{
- friend class SMESH_Actor;
+ friend class SMESH_ActorDef;
public:
vtkTypeMacro(SMESH_DeviceActor,vtkLODActor);