#include <vtkImplicitBoolean.h>
#include <vtkImplicitFunctionCollection.h>
+#include <vtkConfigure.h>
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
#include "utilities.h"
#ifdef _DEBUG_
SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear)
+ const char* theEntry,
+ const char* theName,
+ int theIsClear)
{
SMESH_ActorDef* anActor = SMESH_ActorDef::New();
if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){
myControlsPrecision = -1;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
-
+
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
- vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
-
+ vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
+ vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
+ vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+
vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
- //Definition 2D and 3D divices of the actor
+ //Definition 2D and 3D devices of the actor
//-----------------------------------------
vtkFloatingPointType anRGB[3] = {1,1,1};
mySurfaceProp = vtkProperty::New();
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
- //Definition 1D divice of the actor
+ //Definition 1D device of the actor
//---------------------------------
myEdgeProp = vtkProperty::New();
myEdgeProp->SetAmbient(1.0);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
- //Definition 0D divice of the actor
- //---------------------------------
+ //Definition 0D device of the actor (0d elements)
+ //-----------------------------------------------
+ my0DProp = vtkProperty::New();
+ SMESH::GetColor( "SMESH", "elem0d_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
+ my0DProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ my0DProp->SetPointSize(aElem0DSize);
+
+ my0DActor = SMESH_DeviceActor::New();
+ my0DActor->SetUserMatrix(aMatrix);
+ my0DActor->SetStoreClippingMapping(true);
+ my0DActor->PickableOff();
+ my0DActor->SetVisibility(false);
+ my0DActor->SetProperty(my0DProp);
+ my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+ aFilter = my0DActor->GetExtractUnstructuredGrid();
+ //aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+ aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ aFilter->RegisterCellsWithType(VTK_VERTEX);
+
+ //my0DExtProp = vtkProperty::New();
+ //my0DExtProp->DeepCopy(my0DProp);
+ //anRGB[0] = 1 - anRGB[0];
+ //anRGB[1] = 1 - anRGB[1];
+ //anRGB[2] = 1 - anRGB[2];
+ //my0DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+ //my0DExtProp->SetPointSize(aElem0DSize);
+ //
+ //my0DExtActor = SMESH_DeviceActor::New();
+ //my0DExtActor->SetUserMatrix(aMatrix);
+ //my0DExtActor->SetStoreClippingMapping(true);
+ //my0DExtActor->PickableOff();
+ //my0DExtActor->SetHighlited(true);
+ //my0DExtActor->SetVisibility(false);
+ //my0DExtActor->SetProperty(my0DExtProp);
+ //my0DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
+ //aFilter = my0DExtActor->GetExtractUnstructuredGrid();
+ ////aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+ //aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+ //aFilter->RegisterCellsWithType(VTK_VERTEX);
+
+
+ //Definition 0D device of the actor (nodes)
+ //-----------------------------------------
myNodeProp = vtkProperty::New();
SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myBaseActor->GetProperty()->SetOpacity(0.0);
myPickableActor = myBaseActor;
-
+
myHighlightProp = vtkProperty::New();
myHighlightProp->SetAmbient(1.0);
myHighlightProp->SetDiffuse(0.0);
myHighlightProp->SetSpecular(0.0);
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- myHighlightProp->SetPointSize(aPointSize);
+ //myHighlightProp->SetPointSize(aPointSize);
+ myHighlightProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
myHighlightProp->SetRepresentation(1);
-
+
myPreselectProp = vtkProperty::New();
myPreselectProp->SetAmbient(1.0);
myPreselectProp->SetDiffuse(0.0);
myPreselectProp->SetSpecular(0.0);
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- myPreselectProp->SetPointSize(aPointSize);
+ //myPreselectProp->SetPointSize(aPointSize);
+ myPreselectProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
myPreselectProp->SetRepresentation(1);
myHighlitableActor = SMESH_DeviceActor::New();
myHighlitableActor->PickableOff();
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
+ aMatrix->Delete();
+
myName = "";
myIO = NULL;
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION < 0x050200)
myPtsLabeledDataMapper->SetLabelFormat("%g");
+#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION < 0x050200)
myClsLabeledDataMapper->SetLabelFormat("%g");
+#endif
myClsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aClsTextProp = vtkTextProperty::New();
myNodeProp->Delete();
myNodeExtProp->Delete();
+ my0DProp->Delete();
+ my0DActor->Delete();
+
+ //my0DExtProp->Delete();
+ //my0DExtActor->Delete();
+
my1DProp->Delete();
my1DActor->Delete();
myHighlitableActor->Delete();
- //Deleting of pints numbering pipeline
+ //Deleting of points numbering pipeline
//---------------------------------------
myPointsNumDataSet->Delete();
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues( aNbElem );
- for ( int anId = 0; anId < aNbElem; anId++ )
+ for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{
int aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId );
return myIsFacesOriented;
}
+void SMESH_ActorDef::SetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ my2DActor->SetFacesOrientationColor( theColor );
+ my3DActor->SetFacesOrientationColor( theColor );
+}
+
+void SMESH_ActorDef::GetFacesOrientationColor(vtkFloatingPointType theColor[3])
+{
+ my3DActor->GetFacesOrientationColor( theColor );
+}
+
+void SMESH_ActorDef::SetFacesOrientationScale(vtkFloatingPointType theScale)
+{
+ my2DActor->SetFacesOrientationScale( theScale );
+ my3DActor->SetFacesOrientationScale( theScale );
+}
+
+vtkFloatingPointType SMESH_ActorDef::GetFacesOrientationScale()
+{
+ return my3DActor->GetFacesOrientationScale();
+}
+
+void SMESH_ActorDef::SetFacesOrientation3DVectors(bool theState)
+{
+ my2DActor->SetFacesOrientation3DVectors( theState );
+ my3DActor->SetFacesOrientation3DVectors( theState );
+}
+
+bool SMESH_ActorDef::GetFacesOrientation3DVectors()
+{
+ return my3DActor->GetFacesOrientation3DVectors();
+}
+
void
SMESH_ActorDef::
void
SMESH_ActorDef::
SetControlMode(eControl theMode,
- bool theCheckEntityMode)
+ bool theCheckEntityMode)
{
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( !mgr )
myControlMode = eNone;
theCheckEntityMode &= mgr->booleanValue( "SMESH", "display_entity", false );
+ my0DActor->GetMapper()->SetScalarVisibility(false);
my1DActor->GetMapper()->SetScalarVisibility(false);
my2DActor->GetMapper()->SetScalarVisibility(false);
my3DActor->GetMapper()->SetScalarVisibility(false);
myControlMode = theMode;
switch(myControlMode){
case eFreeNodes:
- myNodeExtActor->SetExtControlMode(aFunctor);
- break;
+ myNodeExtActor->SetExtControlMode(aFunctor);
+ break;
case eFreeEdges:
case eFreeBorders:
- my1DExtActor->SetExtControlMode(aFunctor);
- break;
+ my1DExtActor->SetExtControlMode(aFunctor);
+ break;
case eFreeFaces:
- my2DExtActor->SetExtControlMode(aFunctor);
- break;
+ my2DExtActor->SetExtControlMode(aFunctor);
+ break;
case eLength2D:
case eMultiConnection2D:
- my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
- break;
+ my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
+ break;
default:
- myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
+ myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
}
}
if(theCheckEntityMode){
if(myControlActor == my1DActor)
- SetEntityMode(eEdges);
+ SetEntityMode(eEdges);
else if(myControlActor == my2DActor){
- switch(myControlMode){
- case eLength2D:
- case eFreeEdges:
- case eFreeFaces:
- case eMultiConnection2D:
- //SetEntityMode(eEdges);
- SetEntityMode(eFaces);
- break;
- default:
- SetEntityMode(eFaces);
- }
+ switch(myControlMode){
+ case eLength2D:
+ case eFreeEdges:
+ case eFreeFaces:
+ case eMultiConnection2D:
+ //SetEntityMode(eEdges);
+ SetEntityMode(eFaces);
+ break;
+ default:
+ SetEntityMode(eFaces);
+ }
}else if(myControlActor == my3DActor)
- SetEntityMode(eVolumes);
+ SetEntityMode(eVolumes);
}
}else if(theCheckEntityMode){
theRenderer->AddActor(my1DActor);
theRenderer->AddActor(my1DExtActor);
+ theRenderer->AddActor(my0DActor);
+ //theRenderer->AddActor(my0DExtActor);
+
theRenderer->AddActor(myHighlitableActor);
theRenderer->AddActor2D(myScalarBarActor);
theRenderer->RemoveActor(myHighlitableActor);
+ theRenderer->RemoveActor(my0DActor);
+ //theRenderer->RemoveActor(my0DExtActor);
+
theRenderer->RemoveActor(my1DActor);
theRenderer->RemoveActor(my1DExtActor);
bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear)
+ const char* theEntry,
+ const char* theName,
+ int theIsClear)
{
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName);
setIO(anIO);
myNodeExtActor->Init(myVisualObj,myImplicitBoolean);
+ my0DActor->Init(myVisualObj,myImplicitBoolean);
+ //my0DExtActor->Init(myVisualObj,myImplicitBoolean);
+
my1DActor->Init(myVisualObj,myImplicitBoolean);
my1DExtActor->Init(myVisualObj,myImplicitBoolean);
my2DExtActor->Init(myVisualObj,myImplicitBoolean);
my3DActor->Init(myVisualObj,myImplicitBoolean);
+ my0DActor->GetMapper()->SetLookupTable(myLookupTable);
+ //my0DExtActor->GetMapper()->SetLookupTable(myLookupTable);
+
my1DActor->GetMapper()->SetLookupTable(myLookupTable);
my1DExtActor->GetMapper()->SetLookupTable(myLookupTable);
myNodeExtActor->SetTransform(theTransform);
+ my0DActor->SetTransform(theTransform);
+ //my0DExtActor->SetTransform(theTransform);
+
my1DActor->SetTransform(theTransform);
my1DExtActor->SetTransform(theTransform);
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
aDataSet->Update();
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
- aDataSet->GetNumberOfCells() == 1 &&
- aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX;
+ ( aDataSet->GetNumberOfCells() == 1 &&
+ aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX );
return SALOME_Actor::IsInfinitive();
}
myNodeExtActor->VisibilityOff();
+ my0DActor->VisibilityOff();
+ //my0DExtActor->VisibilityOff();
+
my1DActor->VisibilityOff();
my1DExtActor->VisibilityOff();
if(myControlMode != eNone){
switch(myControlMode){
case eFreeNodes:
- myNodeExtActor->VisibilityOn();
- break;
+ myNodeExtActor->VisibilityOn();
+ break;
case eFreeEdges:
case eFreeBorders:
- my1DExtActor->VisibilityOn();
- break;
+ my1DExtActor->VisibilityOn();
+ break;
case eFreeFaces:
- my2DExtActor->VisibilityOn();
- break;
+ my2DExtActor->VisibilityOn();
+ break;
case eLength2D:
case eMultiConnection2D:
- my1DExtActor->VisibilityOn();
+ my1DExtActor->VisibilityOn();
default:
- if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
- myScalarBarActor->VisibilityOn();
+ if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+ myScalarBarActor->VisibilityOn();
}
}
myNodeActor->VisibilityOn();
}
+ if(myEntityMode & e0DElements){
+ my0DActor->VisibilityOn();
+ }
+
if(myEntityMode & eEdges){
my1DActor->VisibilityOn();
}
}
-void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
+void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
+{
myEntityState = eAllEntity;
- if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)){
+ if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
+ myEntityState &= ~e0DElements;
+ theMode &= ~e0DElements;
+ }
+
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)) {
myEntityState &= ~eEdges;
theMode &= ~eEdges;
}
- if(!myVisualObj->GetNbEntities(SMDSAbs_Face)){
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Face)) {
myEntityState &= ~eFaces;
theMode &= ~eFaces;
}
- if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)){
+ if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)) {
myEntityState &= ~eVolumes;
theMode &= ~eVolumes;
}
- if(!theMode){
+ if (!theMode) {
+ if(myVisualObj->GetNbEntities(SMDSAbs_0DElement))
+ theMode |= e0DElements;
+
if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
theMode |= eEdges;
aFilter = myBaseActor->GetExtractUnstructuredGrid();
aFilter->ClearRegisteredCellsWithType();
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
-
- if(myEntityMode & eEdges){
+
+ VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
+ aHightFilter->ClearRegisteredCellsWithType();
+ aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
+ if (myEntityMode & e0DElements) {
+ if (MYDEBUG) MESSAGE("0D ELEMENTS");
+ aFilter->RegisterCellsWithType(VTK_VERTEX);
+ aHightFilter->RegisterCellsWithType(VTK_VERTEX);
+ }
+
+ if (myEntityMode & eEdges) {
if (MYDEBUG) MESSAGE("EDGES");
aFilter->RegisterCellsWithType(VTK_LINE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+
+ aHightFilter->RegisterCellsWithType(VTK_LINE);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
}
- if(myEntityMode & eFaces){
+ if (myEntityMode & eFaces) {
if (MYDEBUG) MESSAGE("FACES");
aFilter->RegisterCellsWithType(VTK_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_POLYGON);
aFilter->RegisterCellsWithType(VTK_QUAD);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+
+ aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
+ aHightFilter->RegisterCellsWithType(VTK_POLYGON);
+ aHightFilter->RegisterCellsWithType(VTK_QUAD);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
}
- if(myEntityMode & eVolumes){
+ if (myEntityMode & eVolumes) {
if (MYDEBUG) MESSAGE("VOLUMES");
aFilter->RegisterCellsWithType(VTK_TETRA);
aFilter->RegisterCellsWithType(VTK_VOXEL);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+
+ aHightFilter->RegisterCellsWithType(VTK_TETRA);
+ aHightFilter->RegisterCellsWithType(VTK_VOXEL);
+ aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+ aHightFilter->RegisterCellsWithType(VTK_WEDGE);
+ aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+ aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+ aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
}
aFilter->Update();
if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
SetVisibility(GetVisibility(),false);
}
-void SMESH_ActorDef::SetRepresentation(int theMode){
+void SMESH_ActorDef::SetRepresentation (int theMode)
+{
int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
- if(theMode < 0){
+
+ if (theMode < 0) {
myRepresentation = eSurface;
- if(!aNbFaces && !aNbVolumes && aNbEdges){
+ if (!aNbFaces && !aNbVolumes && aNbEdges) {
myRepresentation = eEdge;
- }else if(!aNbFaces && !aNbVolumes && !aNbEdges){
+ } else if (!aNbFaces && !aNbVolumes && !aNbEdges) {
myRepresentation = ePoint;
}
- }else{
- switch(theMode){
+ } else {
+ switch (theMode) {
case eEdge:
- if(!aNbFaces && !aNbVolumes && !aNbEdges) return;
+ if (!aNbFaces && !aNbVolumes && !aNbEdges) return;
break;
case eSurface:
- if(!aNbFaces && !aNbVolumes) return;
+ if (!aNbFaces && !aNbVolumes) return;
break;
}
myRepresentation = theMode;
}
- if(!GetUnstructuredGrid()->GetNumberOfCells())
+ if (!GetUnstructuredGrid()->GetNumberOfCells())
myRepresentation = ePoint;
- if(myIsShrunk){
- if(myRepresentation == ePoint){
+ if (myIsShrunk) {
+ if (myRepresentation == ePoint) {
UnShrink();
myIsShrunk = true;
- }else{
+ } else {
SetShrink();
}
}
vtkProperty *aProp = NULL, *aBackProp = NULL;
SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1);
SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation();
- switch(myRepresentation){
+ switch (myRepresentation) {
case ePoint:
myPickableActor = myNodeActor;
myNodeActor->SetVisibility(true);
aBackProp = myBackSurfaceProp;
aReperesent = SMESH_DeviceActor::eSurface;
break;
- }
+ }
my2DActor->SetProperty(aProp);
my2DActor->SetBackfaceProperty(aBackProp);
my3DActor->SetBackfaceProperty(aBackProp);
my3DActor->SetRepresentation(aReperesent);
+ //my0DExtActor->SetVisibility(false);
my1DExtActor->SetVisibility(false);
my2DExtActor->SetVisibility(false);
+ // ???
+ //my0DActor->SetProperty(aProp);
+ //my0DActor->SetBackfaceProperty(aBackProp);
+ my0DActor->SetRepresentation(aReperesent);
+ //my0DExtActor->SetRepresentation(aReperesent);
+
switch(myControlMode){
case eLength:
case eMultiConnection:
my1DActor->SetQuadraticArcMode(false);
else if(aQuadraticMode == SMESH_Actor::eArcs)
my1DActor->SetQuadraticArcMode(true);
-
-
+
my1DActor->SetProperty(aProp);
my1DActor->SetBackfaceProperty(aBackProp);
my1DActor->SetRepresentation(aReperesent);
my1DExtActor->SetRepresentation(aReperesent);
-
+
if(myIsPointsVisible)
myPickableActor = myNodeActor;
if(GetPointRepresentation())
myHighlitableActor->SetHighlited(anIsVisible);
myHighlitableActor->SetVisibility(anIsVisible);
myHighlitableActor->GetExtractUnstructuredGrid()->
- SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
+ SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
}else if(myRepresentation == ePoint || GetPointRepresentation()){
myHighlitableActor->SetHighlited(anIsVisible);
myHighlitableActor->GetExtractUnstructuredGrid()->
- SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+ SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
myHighlitableActor->SetVisibility(anIsVisible);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
}
void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
mySurfaceProp->SetColor(r,g,b);
- myNameActor->SetBackgroundColor(r,g,b);
+ if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+ if( aGroupObj->GetElementType() == SMDSAbs_Face ||
+ aGroupObj->GetElementType() == SMDSAbs_Volume )
+ myNameActor->SetBackgroundColor(r,g,b);
Modified();
}
myEdgeProp->SetColor(r,g,b);
my1DProp->SetColor(r,g,b);
my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
+ if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+ if( aGroupObj->GetElementType() == SMDSAbs_Edge )
+ myNameActor->SetBackgroundColor(r,g,b);
Modified();
}
void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myNodeProp->SetColor(r,g,b);
myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
+ if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+ if( aGroupObj->GetElementType() == SMDSAbs_Node )
+ myNameActor->SetBackgroundColor(r,g,b);
Modified();
}
::GetColor(myNodeProp,r,g,b);
}
+void SMESH_ActorDef::Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
+ my0DProp->SetColor(r,g,b);
+ Modified();
+}
+
+void SMESH_ActorDef::Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b){
+ ::GetColor(my0DProp,r,g,b);
+}
+
void SMESH_ActorDef::SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
myHighlightProp->SetColor(r,g,b);
Modified();
void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){
myNodeProp->SetPointSize(theVal);
myNodeExtProp->SetPointSize(theVal);
- myHighlightProp->SetPointSize(theVal);
- myPreselectProp->SetPointSize(theVal);
+
+ vtkFloatingPointType aPointSize = my0DProp->GetPointSize() > theVal ? my0DProp->GetPointSize() : theVal;
+ //myHighlightProp->SetPointSize(theVal);
+ myHighlightProp->SetPointSize(aPointSize); // ??
+ //myPreselectProp->SetPointSize(theVal);
+ myPreselectProp->SetPointSize(aPointSize); // ??
my1DProp->SetPointSize(theVal + aPointSizeInc);
my1DExtProp->SetPointSize(theVal + aPointSizeInc);
return myNodeProp->GetPointSize();
}
+void SMESH_ActorDef::Set0DSize(vtkFloatingPointType theVal){
+ my0DProp->SetPointSize(theVal);
+
+ vtkFloatingPointType aPointSize = myNodeProp->GetPointSize() > theVal ? myNodeProp->GetPointSize() : theVal;
+ //myHighlightProp->SetPointSize(theVal);
+ myHighlightProp->SetPointSize(aPointSize); // ??
+ //myPreselectProp->SetPointSize(theVal);
+ myPreselectProp->SetPointSize(aPointSize); // ??
+
+ Modified();
+}
+
+vtkFloatingPointType SMESH_ActorDef::Get0DSize(){
+ return my0DProp->GetPointSize();
+}
+
int SMESH_ActorDef::GetObjDimension( const int theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
}
void
-SMESH_ActorDef::
-SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
+SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
{
myNodeActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-
+
myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
myNodeExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-
+
+ my0DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+ //my0DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+
my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-
+
my2DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my2DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
my3DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
}
vtkIdType
-SMESH_ActorDef::
-AddClippingPlane(vtkPlane* thePlane)
+SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
{
if(thePlane){
myImplicitBoolean->GetFunction()->AddItem(thePlane);
static void ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
{
vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
}
vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
static void DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
static void PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);