SHADED,
INSIDEFRAME,
SURFACEFRAME,
+ FEATURE_EDGES,
SHRINK
};
<parameter name="scalar_def_represent" value="2"/>
<parameter name="scalar_def_shrink" value="false"/>
<parameter name="represent_shading" value="false"/>
+ <parameter name="feature_edges_angle" value="30.0"/>
+ <parameter name="feature_edges" value="true"/>
+ <parameter name="boundary_edges" value="false"/>
+ <parameter name="manifold_edges" value="false"/>
+ <parameter name="non_manifold_edges" value="false"/>
+ <parameter name="feature_edges_coloring" value="false"/>
<parameter name="scalar_bar_horizontal_height" value="0.05"/>
<parameter name="scalar_bar_horizontal_width" value="0.5" />
<parameter name="scalar_bar_horizontal_x" value="0.01"/>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPassThroughFilter.h>
+#include <vtkFeatureEdges.h>
#include <vtkShrinkFilter.h>
#include <vtkShrinkPolyData.h>
myAnnotationMapper(vtkTextMapper::New()),
myAnnotationActor(vtkTextActor::New()),
myTextActor(VISU_FramedTextActor::New()),
+ myIsFeatureEdgesAllowed(false),
+ myIsFeatureEdgesEnabled(false),
+ myFeatureEdges(vtkFeatureEdges::New()),
myLastSelectionMode(ActorSelection),
myIsSubElementsHighlighted(false)
{
myTextActor->SetVisibility(false);
myTextActor->SetPickable(false);
+ myFeatureEdges->Delete();
+
myEventCallbackCommand->Delete();
myEventCallbackCommand->SetClientData(this);
myEventCallbackCommand->SetCallback(VISU_Actor::ProcessEvents);
SetShrink();
else
UnShrink();
+
+ SetFeatureEdgesAllowed(theActor->IsFeatureEdgesAllowed());
+ SetFeatureEdgesEnabled(theActor->IsFeatureEdgesEnabled());
+ SetFeatureEdgesAngle(theActor->GetFeatureEdgesAngle());
+ bool aFeatureEdges = false, aBoundaryEdges = false, aManifoldEdges = false, aNonManifoldEdges = false;
+ theActor->GetFeatureEdgesFlags( aFeatureEdges, aBoundaryEdges, aManifoldEdges, aNonManifoldEdges );
+ SetFeatureEdgesFlags( aFeatureEdges, aBoundaryEdges, aManifoldEdges, aNonManifoldEdges );
+ SetFeatureEdgesColoring(theActor->GetFeatureEdgesColoring());
+
SetOpacity(theActor->GetOpacity());
SetLineWidth(theActor->GetLineWidth());
SetPosition(theActor->GetPosition());
if(vtkMapper *aMapper = myPipeLine->GetMapper()){
if(vtkDataSet *aDataSet = aMapper->GetInput()){
SetShrinkable(thePipeLine->IsShrinkable());
+ SetFeatureEdgesAllowed(thePipeLine->IsFeatureEdgesAllowed());
SetMapperInput(aDataSet);
}
}
{
Superclass::SetRepresentation(theMode);
if(myRepresentation == VTK_POINTS)
+ {
UnShrink();
+ SetFeatureEdgesEnabled( false );
+ }
}
}
+//----------------------------------------------------------------------------
+bool
+VISU_Actor
+::IsFeatureEdgesAllowed()
+{
+ return myIsFeatureEdgesAllowed;
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ myIsFeatureEdgesAllowed = theIsFeatureEdgesAllowed;
+}
+
+bool
+VISU_Actor
+::IsFeatureEdgesEnabled()
+{
+ return myIsFeatureEdgesEnabled;
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled )
+ return;
+
+ if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
+ {
+ if( theIsFeatureEdgesEnabled )
+ {
+ myFeatureEdges->SetInput( aPolyData );
+ myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() );
+ myIsFeatureEdgesEnabled = true;
+ }
+ else
+ {
+ myPassFilter[3]->SetInput( aPolyData );
+ myPassFilter[3]->Modified();
+ myIsFeatureEdgesEnabled = false;
+ Modified();
+ }
+ myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled;
+ }
+}
+
+vtkFloatingPointType
+VISU_Actor
+::GetFeatureEdgesAngle()
+{
+ return myFeatureEdges->GetFeatureAngle();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ myFeatureEdges->SetFeatureAngle(theValue);
+ Modified();
+}
+
+void
+VISU_Actor
+::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges)
+{
+ theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
+ theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
+ theIsManifoldEdges = myFeatureEdges->GetManifoldEdges();
+ theIsNonManifoldEdges = myFeatureEdges->GetNonManifoldEdges();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
+{
+ myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
+ myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
+ myFeatureEdges->SetManifoldEdges(theIsManifoldEdges);
+ myFeatureEdges->SetNonManifoldEdges(theIsNonManifoldEdges);
+ Modified();
+}
+
+bool
+VISU_Actor
+::GetFeatureEdgesColoring()
+{
+ return myFeatureEdges->GetColoring();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ myFeatureEdges->SetColoring(theIsColoring);
+ Modified();
+}
+
//----------------------------------------------------------------------------
void
VISU_Actor
aSize += aDataSet->GetActualMemorySize() * 1024;
}
+ if(IsFeatureEdgesEnabled()){
+ vtkPolyData* aPolyData = myFeatureEdges->GetOutput();
+ aSize += aPolyData->GetActualMemorySize() * 1024;
+ }
+
return aSize;
}
class VISU_PipeLine;
class vtkPlane;
class vtkImplicitFunctionCollection;
+class vtkFeatureEdges;
class VISU_FramedTextActor;
namespace Representation
{
const Type Surfaceframe = Insideframe + 1;
+ const Type FeatureEdges = Insideframe + 2;
}
}
vtkFloatingPointType
GetShrinkFactor();
+ //----------------------------------------------------------------------------
+ virtual
+ bool
+ IsFeatureEdgesAllowed();
+
+ virtual
+ void
+ SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ bool
+ IsFeatureEdgesEnabled();
+
+ virtual
+ void
+ SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+ virtual
+ vtkFloatingPointType
+ GetFeatureEdgesAngle();
+
+ virtual
+ void
+ SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0);
+
+ virtual
+ void
+ GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges);
+
+ virtual
+ void
+ SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
+
+ virtual
+ bool
+ GetFeatureEdgesColoring();
+
+ virtual
+ void
+ SetFeatureEdgesColoring(bool theIsColoring);
+
//----------------------------------------------------------------------------
virtual
void
vtkSmartPointer<VISU_FramedTextActor> myTextActor;
+ vtkSmartPointer<vtkFeatureEdges> myFeatureEdges;
+ bool myIsFeatureEdgesAllowed;
+ bool myIsFeatureEdgesEnabled;
+
Selection_Mode myLastSelectionMode;
bool myIsSubElementsHighlighted;
};
myEdgeActor->UnShrink();
}
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+ mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ Superclass::SetFeatureEdgesAngle(theValue);
+
+ mySurfaceActor->SetFeatureEdgesAngle(theValue);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
+{
+ Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+
+ mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+ mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
+ return;
+
+ Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+ mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
//----------------------------------------------------------------------------
void
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
myEdgeActor->RenderOpaqueGeometry(ren);
break;
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ mySurfaceActor->RenderOpaqueGeometry(ren);
+ break;
}
return 1;
}
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
myEdgeActor->RenderTranslucentGeometry(ren);
break;
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ mySurfaceActor->RenderTranslucentGeometry(ren);
+ break;
}
return 1;
}
void
UnShrink();
+ virtual
+ void
+ SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ void
+ SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+ virtual
+ void
+ SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0);
+
+ virtual
+ void
+ SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
+
+ virtual
+ void
+ SetFeatureEdgesColoring(bool theIsColoring);
+
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int
::VISU_CutLinesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myCondition = 1;
myPosition = 0;
::VISU_CutPlanesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myAppendPolyData = vtkAppendPolyData::New();
myScaleFactor(0.0)
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(false);
myWarpVector = vtkWarpVector::New();
myCellDataToPointData = vtkCellDataToPointData::New();
myMergeFilter(VISU_GaussMergeFilter::New())
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myWarpVector = vtkWarpVector::New();
::VISU_IsoSurfacesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myContourFilter = vtkContourFilter::New();
VISU_UnstructuredGridPL(this)
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(true);
}
//----------------------------------------------------------------------------
VISU_PipeLine
::VISU_PipeLine():
- myIsShrinkable(true)
+ myIsShrinkable(true),
+ myIsFeatureEdgesAllowed(true)
{
if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
}
}
+//----------------------------------------------------------------------------
+bool
+VISU_PipeLine
+::IsFeatureEdgesAllowed()
+{
+ return myIsFeatureEdgesAllowed;
+}
+
+void
+VISU_PipeLine
+::SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ if(myIsFeatureEdgesAllowed == theIsFeatureEdgesAllowed)
+ return;
+
+ myIsFeatureEdgesAllowed = theIsFeatureEdgesAllowed;
+ Modified();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_PipeLine
bool
IsShrinkable();
+ bool
+ IsFeatureEdgesAllowed();
+
//----------------------------------------------------------------------------
void
SetImplicitFunction(vtkImplicitFunction *theFunction);
void
SetIsShrinkable(bool theIsShrinkable);
+ void
+ SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
private:
//----------------------------------------------------------------------------
vtkSmartPointer<VISU_MapperHolder> myMapperHolder;
bool myIsShrinkable;
+ bool myIsFeatureEdgesAllowed;
};
#endif
myScaleFactor(1.0)
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myCellDataToPointData->Delete();
myAppendPolyData->Delete();
myMergeFilter(VISU_MergeFilter::New())
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(false);
myAppendFilter->SetMergingInputs(true);
myAppendFilter->Delete();
::VISU_StreamLinesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myStream = vtkStreamLine::New();
myCenters = vtkCellCenters::New();
::VISU_VectorsPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myBaseGlyph = vtkGlyph3D::New();
myTransformedGlyph = vtkGlyph3D::New();
anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
+
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ anActor->SetFeatureEdgesEnabled( myPresentType == VISU::FEATURE_EDGES );
+ anActor->SetFeatureEdgesAngle( aResourceMgr->doubleValue("VISU", "feature_edges_angle", 0.0) );
+ anActor->SetFeatureEdgesFlags( aResourceMgr->booleanValue("VISU", "feature_edges", false),
+ aResourceMgr->booleanValue("VISU", "boundary_edges", false),
+ aResourceMgr->booleanValue("VISU", "manifold_edges", false),
+ aResourceMgr->booleanValue("VISU", "non_manifold_edges", false) );
+ anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
}
}