myHighlightProp(vtkProperty::New()),
myPreHighlightProp(vtkProperty::New()),
- myShadingFaceProp(vtkProperty::New())
-
+ myShadingFaceProp(vtkProperty::New()),
+ isOnlyVertex(false)
{
#ifdef MYDEBUG
MESSAGE (this<< " GEOM_Actor::GEOM_Actor");
myHighlightProp->SetAmbientColor(1, 1, 1);
myHighlightProp->SetDiffuseColor(1, 1, 1);
myHighlightProp->SetSpecularColor(0.5, 0.5, 0.5);
+ myHighlightProp->SetPointSize(SALOME_POINT_SIZE);
myHighlightActor->SetProperty(myHighlightProp.GetPointer());
this->myHighlightActor->SetInput(myAppendFilter->GetOutput(),false);
myOneFaceEdgeActor->SetVisibility(theVisibility && myDisplayMode == (int)eWireframe && !myIsSelected);
myIsolatedEdgeActor->SetVisibility(theVisibility && !myIsSelected);
-// myVertexActor->SetVisibility(false);// must be added new mode points
- myVertexActor->SetVisibility(theVisibility);
+ myVertexActor->SetVisibility(theVisibility && !myIsSelected);
}
mySharedEdgeSource->Clear();
myWireframeFaceSource->Clear();
myShadingFaceSource->Clear();
-
- TopExp_Explorer aVertexExp (theShape,TopAbs_VERTEX);
+
+ TopExp_Explorer aVertexExp (theShape,TopAbs_VERTEX);
for (; aVertexExp.More(); aVertexExp.Next())
{
const TopoDS_Vertex& aVertex = TopoDS::Vertex(aVertexExp.Current());
// look if edges are free or shared
TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
-
+
SetShape(theShape,anEdgeMap,theIsVector);
+ isOnlyVertex =
+ myIsolatedEdgeSource->IsEmpty() &&
+ myOneFaceEdgeSource->IsEmpty() &&
+ mySharedEdgeSource->IsEmpty() &&
+ myWireframeFaceSource->IsEmpty() &&
+ myShadingFaceSource->IsEmpty();
+
+
+ if((bool)myShape.Infinite() || isOnlyVertex ){
+ myVertexActor->GetDeviceActor()->SetInfinitive(true);
+ myHighlightActor->GetDeviceActor()->SetInfinitive(true);
+ }
}
void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
this->Device->SetBackfaceProperty(this->BackfaceProperty);
}
this->Device->SetProperty(this->Property);
- if(myShape.ShapeType() == TopAbs_VERTEX) {
+ /* if(myShape.ShapeType() == TopAbs_VERTEX) {
if(ren){
//The parameter determine size of vertex actor relate to diagonal of RendererWindow
static vtkFloatingPointType delta = 0.01;
this->GetMatrix(ren->GetActiveCamera(), aMatrix);
this->Device->SetUserMatrix(aMatrix);
this->Device->Render(ren,theMapper);
- aMatrix->Delete();
- } else
- this->Device->Render(ren, theMapper);
+ aMatrix->Delete();
+ } else*/
+ this->Device->Render(ren, theMapper);
}
void GEOM_Actor::ReleaseGraphicsResources(vtkWindow *)
myShadingFaceProp->SetOpacity(opa);
myHighlightProp->SetOpacity(opa);
myPreHighlightProp->SetOpacity(opa);
+ myVertexActor->GetProperty()->SetOpacity(opa);
}
vtkFloatingPointType GEOM_Actor::GetOpacity()
bool GEOM_Actor::IsInfinitive()
{
- return (bool)(myShape.Infinite());
+ return ((bool)myShape.Infinite() || isOnlyVertex);
}
/*!
Rz[i] = (pos[i] - this->Position[i])/distance;
}
}
-
+
vtkMath::Cross(vup,Rz,Rx);
vtkMath::Normalize(Rx);
vtkMath::Cross(Rz,Rx,Ry);
#include <vtkPolyDataMapper.h>
#include <vtkPolyDataNormals.h>
#include <vtkActor.h>
-
+#include <VTKViewer_Actor.h>
#include <vtkRenderer.h>
+
+
vtkStandardNewMacro(GEOM_DeviceActor);
myStripper(vtkStripper::New(),true),
myPolyDataMapper(vtkPolyDataMapper::New(),true),
myPolyDataNormals(vtkPolyDataNormals::New(),true),
- myActor(vtkActor::New(),true)
+ myActor(VTKViewer_Actor::New(),true)
{
myStripper->SetInput(myPolyDataNormals->GetOutput());
myPolyDataMapper->SetInput(myStripper->GetOutput());
RemoveFromRender(vtkRenderer* theRenderer)
{
theRenderer->RemoveActor(myActor.GetPointer());
-}
\ No newline at end of file
+}