mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-25 01:40:34 +05:00
Fixing visibility of standalone vertices in compound in VTK viewer.
This commit is contained in:
parent
bd2026a383
commit
d50ae9ad41
@ -721,7 +721,8 @@ bool GEOMGUI_Selection::isPhysicalMaterial( const int idx ) const
|
||||
GEOM_Actor* aGeomGActor = GEOM_Actor::SafeDownCast( actor );
|
||||
if ( aGeomGActor ) {
|
||||
GEOM_VTKPropertyMaterial* mat = GEOM_VTKPropertyMaterial::SafeDownCast(aGeomGActor->GetProperty());
|
||||
res = mat->GetPhysical();
|
||||
if ( mat )
|
||||
res = mat->GetPhysical();
|
||||
} // if ( salome actor )
|
||||
} // if ( actor )
|
||||
} // if ( lst == vtkPrs->GetObjects() )
|
||||
|
@ -87,6 +87,9 @@ GEOM_Actor::GEOM_Actor():
|
||||
myVertexActor(GEOM_DeviceActor::New(),true),
|
||||
myVertexSource(GEOM_VertexSource::New(),true),
|
||||
|
||||
myStandaloneVertexActor(GEOM_DeviceActor::New(),true),
|
||||
myStandaloneVertexSource(GEOM_VertexSource::New(),true),
|
||||
|
||||
myIsolatedEdgeActor(GEOM_DeviceActor::New(),true),
|
||||
myIsolatedEdgeSource(GEOM_EdgeSource::New(),true),
|
||||
|
||||
@ -130,13 +133,13 @@ GEOM_Actor::GEOM_Actor():
|
||||
myHighlightProp->SetAmbientColor(1, 1, 1);
|
||||
myHighlightProp->SetDiffuseColor(1, 1, 1);
|
||||
myHighlightProp->SetSpecularColor(0.5, 0.5, 0.5);
|
||||
myHighlightProp->SetPointSize(0);
|
||||
myHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
|
||||
myHighlightActor->SetProperty(myHighlightProp.GetPointer());
|
||||
|
||||
this->myHighlightActor->SetInput(myAppendFilter->GetOutputPort(),false);
|
||||
|
||||
myPreHighlightProp->SetColor(0,1,1);
|
||||
myPreHighlightProp->SetPointSize(0);
|
||||
myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE);
|
||||
myPreHighlightProp->SetLineWidth(SALOME_LINE_WIDTH+1);
|
||||
myPreHighlightProp->SetRepresentationToWireframe();
|
||||
|
||||
@ -147,6 +150,13 @@ GEOM_Actor::GEOM_Actor():
|
||||
aProperty->SetPointSize(3);
|
||||
aProperty->SetColor(1, 1, 0);
|
||||
|
||||
myAppendFilter->AddInputConnection(myStandaloneVertexSource->GetOutputPort());
|
||||
myStandaloneVertexActor->SetInput(myStandaloneVertexSource->GetOutputPort(),false);
|
||||
aProperty = myStandaloneVertexActor->GetProperty();
|
||||
aProperty->SetRepresentation(VTK_POINTS);
|
||||
aProperty->SetPointSize(3);
|
||||
aProperty->SetColor(1, 1, 0);
|
||||
|
||||
myAppendFilter->AddInputConnection(myIsolatedEdgeSource->GetOutputPort());
|
||||
myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutputPort(),false);
|
||||
aProperty = myIsolatedEdgeActor->GetProperty();
|
||||
@ -229,6 +239,7 @@ GEOM_Actor::
|
||||
SetModified()
|
||||
{
|
||||
this->myVertexSource->Modified();
|
||||
this->myStandaloneVertexSource->Modified();
|
||||
this->myIsolatedEdgeSource->Modified();
|
||||
this->myOneFaceEdgeSource->Modified();
|
||||
this->mySharedEdgeSource->Modified();
|
||||
@ -262,6 +273,7 @@ AddToRender(vtkRenderer* theRenderer)
|
||||
myIsolatedEdgeActor->AddToRender(theRenderer);
|
||||
|
||||
myVertexActor->AddToRender(theRenderer);
|
||||
myStandaloneVertexActor->AddToRender(theRenderer);
|
||||
}
|
||||
|
||||
void
|
||||
@ -282,6 +294,7 @@ RemoveFromRender(vtkRenderer* theRenderer)
|
||||
myIsolatedEdgeActor->RemoveFromRender(theRenderer);
|
||||
|
||||
myVertexActor->RemoveFromRender(theRenderer);
|
||||
myStandaloneVertexActor->RemoveFromRender(theRenderer);
|
||||
|
||||
|
||||
SetSelected(false);
|
||||
@ -358,6 +371,8 @@ SetVisibility(int theVisibility)
|
||||
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
|
||||
|
||||
myVertexActor->SetVisibility(theVisibility && (isOnlyVertex || (myVerticesMode && (!myIsSelected && !myIsPreselected))));// must be added new mode points
|
||||
|
||||
myStandaloneVertexActor->SetVisibility(theVisibility);
|
||||
}
|
||||
|
||||
|
||||
@ -399,11 +414,9 @@ GEOM_Actor
|
||||
{
|
||||
myVerticesMode = theMode;
|
||||
if ( theMode || isOnlyVertex ) {
|
||||
myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
|
||||
myHighlightProp->SetPointSize(SALOME_POINT_SIZE);
|
||||
myAppendFilter->AddInputConnection(myVertexSource->GetOutputPort());
|
||||
} else {
|
||||
myPreHighlightProp->SetPointSize(0);
|
||||
myHighlightProp->SetPointSize(0);
|
||||
myAppendFilter->RemoveInputConnection(0, myVertexSource->GetOutputPort());
|
||||
}
|
||||
SetModified();
|
||||
}
|
||||
@ -436,6 +449,7 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
||||
myShape = theShape;
|
||||
|
||||
myVertexSource->Clear();
|
||||
myStandaloneVertexSource->Clear();
|
||||
myIsolatedEdgeSource->Clear();
|
||||
myOneFaceEdgeSource->Clear();
|
||||
mySharedEdgeSource->Clear();
|
||||
@ -456,6 +470,7 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
||||
TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
|
||||
|
||||
GEOM::SetShape(theShape,anEdgeMap,theIsVector,
|
||||
myStandaloneVertexSource.Get(),
|
||||
myIsolatedEdgeSource.Get(),
|
||||
myOneFaceEdgeSource.Get(),
|
||||
mySharedEdgeSource.Get(),
|
||||
@ -471,6 +486,7 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
|
||||
|
||||
if((bool)myShape.Infinite() || isOnlyVertex ){
|
||||
myVertexActor->GetDeviceActor()->SetInfinitive(true);
|
||||
myStandaloneVertexActor->GetDeviceActor()->SetInfinitive(true);
|
||||
myHighlightActor->GetDeviceActor()->SetInfinitive(true);
|
||||
}
|
||||
|
||||
@ -526,6 +542,11 @@ vtkProperty* GEOM_Actor::GetVertexProperty()
|
||||
return myVertexActor->GetProperty();
|
||||
}
|
||||
|
||||
vtkProperty* GEOM_Actor::GetStandaloneVertexProperty()
|
||||
{
|
||||
return myStandaloneVertexActor->GetProperty();
|
||||
}
|
||||
|
||||
vtkProperty* GEOM_Actor::GetSharedEdgeProperty()
|
||||
{
|
||||
return mySharedEdgeActor->GetProperty();
|
||||
@ -715,6 +736,7 @@ void GEOM_Actor::SetOpacity(double opa)
|
||||
myHighlightProp->SetOpacity(opa);
|
||||
myPreHighlightProp->SetOpacity(opa);
|
||||
myVertexActor->GetProperty()->SetOpacity(opa);
|
||||
myStandaloneVertexActor->GetProperty()->SetOpacity(opa);
|
||||
}
|
||||
|
||||
double GEOM_Actor::GetOpacity()
|
||||
@ -755,6 +777,7 @@ void GEOM_Actor::GetColor(double& r,double& g,double& b)
|
||||
void GEOM_Actor::SetPointColor(double r, double g, double b)
|
||||
{
|
||||
myVertexActor->GetProperty()->SetColor(r, g, b);
|
||||
myStandaloneVertexActor->GetProperty()->SetColor(r, g, b);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -818,6 +841,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aCoefnt = theProps[0]->GetAmbient();
|
||||
myShadingFaceProp->SetAmbient(aCoefnt);
|
||||
myVertexActor->GetProperty()->SetAmbient(aCoefnt);
|
||||
myStandaloneVertexActor->GetProperty()->SetAmbient(aCoefnt);
|
||||
if ( aSize == 2 )
|
||||
aCoefnt = theProps[1]->GetAmbient();
|
||||
myShadingBackFaceProp->SetAmbient(aCoefnt);
|
||||
@ -826,6 +850,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aCoefnt = theProps[0]->GetDiffuse();
|
||||
myShadingFaceProp->SetDiffuse(aCoefnt);
|
||||
myVertexActor->GetProperty()->SetDiffuse(aCoefnt);
|
||||
myStandaloneVertexActor->GetProperty()->SetDiffuse(aCoefnt);
|
||||
if ( aSize == 2 )
|
||||
aCoefnt = theProps[1]->GetDiffuse();
|
||||
myShadingBackFaceProp->SetDiffuse(aCoefnt);
|
||||
@ -834,6 +859,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aCoefnt = theProps[0]->GetSpecular();
|
||||
myShadingFaceProp->SetSpecular(aCoefnt);
|
||||
myVertexActor->GetProperty()->SetSpecular(aCoefnt);
|
||||
myStandaloneVertexActor->GetProperty()->SetSpecular(aCoefnt);
|
||||
if ( aSize == 2 )
|
||||
aCoefnt = theProps[1]->GetSpecular();
|
||||
myShadingBackFaceProp->SetSpecular(aCoefnt);
|
||||
@ -845,6 +871,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aColor = theProps[0]->GetAmbientColor();
|
||||
myShadingFaceProp->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
|
||||
myVertexActor->GetProperty()->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
|
||||
myStandaloneVertexActor->GetProperty()->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
|
||||
if ( aSize == 2 )
|
||||
aColor = theProps[1]->GetAmbientColor();
|
||||
myShadingBackFaceProp->SetAmbientColor(aColor[0], aColor[1], aColor[2]);
|
||||
@ -853,6 +880,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aColor = theProps[0]->GetDiffuseColor();
|
||||
myShadingFaceProp->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
|
||||
myVertexActor->GetProperty()->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
|
||||
myStandaloneVertexActor->GetProperty()->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
|
||||
if ( aSize == 2 )
|
||||
aColor = theProps[1]->GetDiffuseColor();
|
||||
myShadingBackFaceProp->SetDiffuseColor(aColor[0], aColor[1], aColor[2]);
|
||||
@ -861,6 +889,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aColor = theProps[0]->GetSpecularColor();
|
||||
myShadingFaceProp->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
|
||||
myVertexActor->GetProperty()->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
|
||||
myStandaloneVertexActor->GetProperty()->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
|
||||
if ( aSize == 2 )
|
||||
aColor = theProps[1]->GetSpecularColor();
|
||||
myShadingBackFaceProp->SetSpecularColor(aColor[0], aColor[1], aColor[2]);
|
||||
@ -869,6 +898,7 @@ void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
|
||||
aCoefnt = theProps[0]->GetSpecularPower();
|
||||
myShadingFaceProp->SetSpecularPower(aCoefnt);
|
||||
myVertexActor->GetProperty()->SetSpecularPower(aCoefnt);
|
||||
myStandaloneVertexActor->GetProperty()->SetSpecularPower(aCoefnt);
|
||||
if ( aSize == 2 )
|
||||
aCoefnt = theProps[1]->GetSpecularPower();
|
||||
myShadingBackFaceProp->SetSpecularPower(aCoefnt);
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
vtkProperty* GetShadingProperty();
|
||||
vtkProperty* GetIsolatedEdgeProperty();
|
||||
vtkProperty* GetVertexProperty();
|
||||
vtkProperty* GetStandaloneVertexProperty();
|
||||
vtkProperty* GetSharedEdgeProperty();
|
||||
vtkProperty* GetFaceEdgeProperty();
|
||||
|
||||
@ -234,6 +235,9 @@ private:
|
||||
PDeviceActor myVertexActor;
|
||||
PVertexSource myVertexSource;
|
||||
|
||||
PDeviceActor myStandaloneVertexActor;
|
||||
PVertexSource myStandaloneVertexSource;
|
||||
|
||||
PDeviceActor myIsolatedEdgeActor;
|
||||
PEdgeSource myIsolatedEdgeSource;
|
||||
|
||||
|
@ -88,6 +88,7 @@ namespace GEOM
|
||||
void SetShape(const TopoDS_Shape& theShape,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
|
||||
bool theIsVector,
|
||||
GEOM_VertexSource* theStandaloneVertexSource,
|
||||
GEOM_EdgeSource* theIsolatedEdgeSource,
|
||||
GEOM_EdgeSource* theOneFaceEdgeSource,
|
||||
GEOM_EdgeSource* theSharedEdgeSource,
|
||||
@ -98,6 +99,7 @@ namespace GEOM
|
||||
TopoDS_Iterator anItr(theShape);
|
||||
for (; anItr.More(); anItr.Next()) {
|
||||
SetShape(anItr.Value(),theEdgeMap,theIsVector,
|
||||
theStandaloneVertexSource,
|
||||
theIsolatedEdgeSource,
|
||||
theOneFaceEdgeSource,
|
||||
theSharedEdgeSource,
|
||||
@ -123,6 +125,10 @@ namespace GEOM
|
||||
break;
|
||||
}
|
||||
case TopAbs_VERTEX: {
|
||||
if ( theStandaloneVertexSource ) {
|
||||
const TopoDS_Vertex& aVertex = TopoDS::Vertex(theShape);
|
||||
theStandaloneVertexSource->AddVertex(aVertex);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
|
||||
class GEOM_VertexSource;
|
||||
class GEOM_EdgeSource;
|
||||
class GEOM_WireframeFace;
|
||||
class GEOM_ShadingFace;
|
||||
@ -40,6 +41,7 @@ namespace GEOM
|
||||
OCC2VTK_EXPORT void SetShape(const TopoDS_Shape& theShape,
|
||||
const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
|
||||
bool theIsVector,
|
||||
GEOM_VertexSource* theStandaloneVertexSource,
|
||||
GEOM_EdgeSource* theIsolatedEdgeSource,
|
||||
GEOM_EdgeSource* theOneFaceEdgeSource,
|
||||
GEOM_EdgeSource* theSharedEdgeSource,
|
||||
|
@ -119,6 +119,7 @@ extern "C"
|
||||
GEOM::SetShape( theShape,
|
||||
anEdgeMap,
|
||||
anIsVector,
|
||||
0, // all vertices were added above
|
||||
myIsolatedEdgeSource,
|
||||
myOneFaceEdgeSource,
|
||||
mySharedEdgeSource,
|
||||
|
Loading…
Reference in New Issue
Block a user