+//==================================================================
+// function: AddToRender
+// purpose :
+//==================================================================
+void
+VISU_Actor
+::AddToRender(vtkRenderer* theRenderer)
+{
+ Superclass::AddToRender(theRenderer);
+ theRenderer->AddActor(myAnnotationActor.GetPointer());
+ theRenderer->AddActor(myTextActor.GetPointer());
+
+ myValSelectVisiblePoints->SetRenderer( theRenderer );
+ theRenderer->AddActor2D( myValLabels );
+
+}
+
+//==================================================================
+// function: RemoveFromRender
+// purpose :
+//==================================================================
+void
+VISU_Actor
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+ theRenderer->RemoveActor(myAnnotationActor.GetPointer());
+ theRenderer->RemoveActor(myTextActor.GetPointer());
+ theRenderer->RemoveActor(myValLabels);
+ Superclass::RemoveFromRender(theRenderer);
+ myDestroySignal(this);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetVisibility(int theMode)
+{
+ Superclass::SetVisibility( theMode );
+ myValLabels->SetVisibility( myIsValLabeled && theMode );
+
+ // Moved from VISU_GaussPtsAct::SetVisibility() (due to IPAL21159)
+ Highlight(isHighlighted());
+}
+//----------------------------------------------------------------------------
+ //! Gets know whether the actor should be displayed or not
+bool
+VISU_Actor
+::ShouldBeDisplayed()
+{
+ return GetFactory()->GetActiveState();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetPosition( double thePosition[3] )
+{
+ Superclass::SetPosition( thePosition );
+ if( vtkCoordinate* aCoord = myValLabels->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( thePosition );
+ myValSelectVisiblePoints->SetOffset( thePosition );
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetPosition( double theX, double theY, double theZ )
+{
+ Superclass::SetPosition( theX, theY, theZ );
+ if( vtkCoordinate* aCoord = myValLabels->GetPositionCoordinate()->GetReferenceCoordinate() )
+ aCoord->SetValue( theX, theY, theZ );
+ myValSelectVisiblePoints->SetOffset( theX, theY, theZ );
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetVTKMapping(bool theIsVTKMapping)
+{
+ myIsVTKMapping = theIsVTKMapping;
+}
+
+bool
+VISU_Actor
+::IsVTKMapping() const
+{
+ return myIsVTKMapping;
+}
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_Actor
+::GetInput()
+{
+ if(myIsVTKMapping)
+ return Superclass::GetInput();
+
+ return GetCurrentPL()->GetOutput();
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_Actor
+::GetMemorySize()
+{
+ static double ERR_SIZE_CALC = 1.00;
+ vtkDataSet* aDataSet = GetMapper()->GetInput();
+ unsigned long int aSize = size_t(aDataSet->GetActualMemorySize() * 1024 * ERR_SIZE_CALC);
+
+ aDataSet = myGeomFilter->GetOutput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(IsShrunk()){
+ aDataSet = myShrinkFilter->GetOutput();
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+ }
+
+ if(IsFeatureEdgesEnabled()){
+ vtkPolyData* aPolyData = myFeatureEdges->GetOutput();
+ aSize += aPolyData->GetActualMemorySize() * 1024;
+ }
+
+ return aSize;
+}
+
+//----------------------------------------------------------------------------
+vtkIdType
+VISU_Actor
+::GetNodeObjId(vtkIdType theID)
+{
+ if(myIsVTKMapping)
+ return Superclass::GetNodeObjId(theID);
+
+ return VISU::GetNodeObjID(GetMapper()->GetInput(), theID);
+}
+
+vtkIdType
+VISU_Actor
+::GetNodeVTKID(vtkIdType theID)
+{
+ if(myIsVTKMapping)
+ return theID;
+
+ return VISU::GetNodeVTKID(GetMapper()->GetInput(), theID);
+}
+
+double*
+VISU_Actor
+::GetNodeCoord(vtkIdType theObjID)
+{
+ if(myIsVTKMapping)
+ return Superclass::GetNodeCoord(theObjID);
+
+ return VISU::GetNodeCoord(GetInput(), theObjID);
+}
+
+
+//----------------------------------------------------------------------------
+vtkIdType
+VISU_Actor
+::GetElemObjId(vtkIdType theID)
+{
+ if(myIsVTKMapping)
+ return Superclass::GetElemObjId(theID);
+
+ return VISU::GetElemObjID(GetMapper()->GetInput(), theID);
+}
+
+vtkIdType
+VISU_Actor
+::GetElemVTKID(vtkIdType theID)
+{
+ if(myIsVTKMapping)
+ return theID;
+
+ return VISU::GetElemVTKID(GetMapper()->GetInput(), theID);
+}
+
+vtkCell*
+VISU_Actor
+::GetElemCell(vtkIdType theObjID)
+{
+ if(myIsVTKMapping)
+ return Superclass::GetElemCell(theObjID);
+
+ return VISU::GetElemCell(GetInput(), theObjID);
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU_Actor
+::isSubElementsHighlighted()
+{
+ return myIsSubElementsHighlighted;
+}
+
+
+//----------------------------------------------------------------------------
+inline
+void
+ChangeZoom(double theZoomFactor,
+ vtkRenderer* theRenderer,
+ vtkIdType theInitialHasIndex,
+ vtkIdType theCurrentHasIndex)
+{
+ //printf( "VISU_Actor::ChangeZoom( %d, %d )", theInitialHasIndex, theCurrentHasIndex );
+ if(theInitialHasIndex + theCurrentHasIndex == 1){
+ vtkCamera *aCamera = theRenderer->GetActiveCamera();
+
+ double aScale = aCamera->GetParallelScale();
+ if ( !theInitialHasIndex && theCurrentHasIndex ) {
+ //printf( " : +%f", theZoomFactor );
+ aCamera->SetParallelScale( aScale / theZoomFactor );
+ }
+ else {
+ //printf( " : -%f", theZoomFactor );
+ aCamera->SetParallelScale( aScale * theZoomFactor );
+ }
+ }
+ //printf( "\n" );
+}
+
+/*!
+ Updates visibility of the highlight devices
+*/
+void
+VISU_Actor
+::highlight(bool theIsHighlight)
+{
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ bool aShowTextActor = aPickingSettings->GetInfoWindowEnabled();
+ if( theIsHighlight && mySelectionMode != myLastSelectionMode )
+ {
+ if( mySelectionMode == ActorSelection )
+ ResetTextActor();
+ myLastSelectionMode = mySelectionMode;
+ }
+
+ myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor &&
+ ( mySelectionMode == ActorSelection || isSubElementsHighlighted() ) );
+
+ bool anInitialHasIndex = isHighlighted();
+ bool aCurrentHasIndex = theIsHighlight;
+
+ if( !theIsHighlight && mySelectionMode == ActorSelection && isSubElementsHighlighted() )
+ {
+ myIsSubElementsHighlighted = false;
+
+ // Zoom
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ double aZoomFactor = aPickingSettings->GetZoomFactor();
+ ChangeZoom(aZoomFactor,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+ }
+ }
+
+ Superclass::highlight(theIsHighlight);
+}
+
+/*!
+ To process prehighlight (called from SVTK_InteractorStyle)
+*/
+bool
+VISU_Actor
+::PreHighlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
+{
+ bool aRet = Superclass::PreHighlight(theInteractorStyle,
+ theSelectionEvent,
+ theIsHighlight);
+#ifndef ENABLE_ANNOTATION
+ return aRet;
+#endif
+ //
+ myAnnotationActor->SetVisibility(0);
+ if(theIsHighlight){
+ switch(mySelectionMode){
+ case CellSelection:{
+ vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
+ myCellPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
+
+ if(myCellPicker->GetActor() != this)
+ return false;
+
+ vtkIdType aVTKId = myCellPicker->GetCellId();
+ if(aVTKId >= 0 && mySelector->IsValid(this,aVTKId,true) && hasIO()){
+ vtkIdType anObjId = GetElemObjId(aVTKId);
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ double aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ double *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+ // Display coordinates
+ double aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ double aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Cell ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
+ }
+ }
+ break;
+ }
+ case NodeSelection:{
+ vtkRenderer* aRenderer = theInteractorStyle->GetCurrentRenderer();
+ myPointPicker->Pick(theSelectionEvent->myX,
+ theSelectionEvent->myY,
+ 0.0,
+ aRenderer);
+
+ if(myPointPicker->GetActor() != this)
+ return false;
+
+ vtkIdType aVtkId = myPointPicker->GetPointId();
+ if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){
+ vtkIdType anObjId = GetNodeObjId( aVtkId );
+ if(double* aCoord = GetNodeCoord(anObjId)){
+ // Display coordinates
+ double aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ double aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myAnnotationActor->SetPosition(aSelectionPoint);
+ //
+ // To prepare the annotation text
+ std::ostringstream aStr;
+ aStr<<"Node ID: "<< anObjId;
+ std::string aString = aStr.str();
+ myAnnotationMapper->SetInput(aString.c_str());
+
+ myAnnotationActor->SetVisibility(1);
+ return true;
+ }
+ }
+ break;
+ }
+ case EdgeOfCellSelection:
+ break;
+ default:
+ break;
+ }
+ }
+
+ return aRet;
+}
+
+void VISU_Actor::RemoveAllClippingPlanes()
+{
+}
+
+vtkIdType VISU_Actor::GetNumberOfClippingPlanes()
+{
+ return 0;
+}
+
+bool VISU_Actor::AddClippingPlane(vtkPlane* thePlane)
+{
+ return false;
+}
+
+vtkPlane* VISU_Actor::GetClippingPlane(vtkIdType theID)
+{
+ return NULL;
+}
+
+vtkImplicitFunctionCollection* VISU_Actor::GetClippingPlanes()
+{
+ return NULL;
+}
+
+//----------------------------------------------------------------------------
+template<class TData> std::string getScalar(TData* theData, int theId)
+{
+ std::ostringstream aStr;
+ if (vtkDataArray *aScalar = theData->GetScalars()){
+ double aVal = aScalar->GetTuple1(theId);
+ aStr << "\nScalar: " << aVal;
+ }
+ return aStr.str();
+}
+
+template<class TData> std::string getVector(TData* theData, int theId)
+{
+ std::ostringstream aStr;
+ if (vtkDataArray *aVector = theData->GetVectors()) {
+ double *aVal = aVector->GetTuple3(theId);
+ aStr << "\nVector: " << "{" << aVal[0] << "; " << aVal[1] << "; " << aVal[2] << "}";
+ }
+ return aStr.str();
+}
+
+/*!
+ To process highlight (called from SVTK_InteractorStyle)
+*/
+bool
+VISU_Actor
+::Highlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
+{
+ return Superclass::Highlight(theInteractorStyle,
+ theSelectionEvent,
+ theIsHighlight);
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::Highlight(bool theIsHighlight)
+{
+ Superclass::Highlight(theIsHighlight);
+
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ bool anInitialHasIndex = isSubElementsHighlighted() && mySelectionMode != ActorSelection;
+
+ TColStd_IndexedMapOfInteger aMapIndex;
+ mySelector->GetIndex( getIO(), aMapIndex );
+ bool aCurrentHasIndex = aMapIndex.Extent() == 1;
+
+ myIsSubElementsHighlighted = aCurrentHasIndex;
+
+ bool aFlyTo = false;
+ double aFlyToCoord[3] = { 0.0, 0.0, 0.0 };
+ vtkRenderer *aRenderer = GetRenderer();
+
+ if( theIsHighlight )
+ {
+ vtkDataSet* aDataSet = GetMapper()->GetInput();
+ switch(mySelectionMode)
+ {
+ case ActorSelection:
+ {
+ ResetTextActor();
+ break;
+ }
+ case CellSelection:
+ {
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkCellData* aCellData = aDataSet->GetCellData();
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ double aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ double *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0] / aNbPts;
+ aFlyToCoord[1] = aCoord[1] / aNbPts;
+ aFlyToCoord[2] = aCoord[2] / aNbPts;
+
+ double aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ double aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Cell ID: " << anObjId;
+
+ vtkCell* aCell = GetElemCell(anObjId);
+ int aVTKID = GetElemVTKID(anObjId);
+ if (aCell) {
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if ( aNbOfPoints > 0 ) {
+ aStr << getScalar(aCellData, aVTKID);
+ aStr << getVector(aCellData, aVTKID);
+ }
+ }
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ }
+ break;
+ }
+ case NodeSelection:
+ {
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkPointData* aPntData = aDataSet->GetPointData();
+ if(double* aCoord = GetNodeCoord(anObjId)){
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0];
+ aFlyToCoord[1] = aCoord[1];
+ aFlyToCoord[2] = aCoord[2];
+
+ double aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ double aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Point ID: " << anObjId;
+
+ int aVTKID = GetNodeVTKID(anObjId);
+ if(aVTKID >= 0) {
+ aStr << getScalar(aPntData, aVTKID);
+ aStr << getVector(aPntData, aVTKID);
+ }
+
+ const VISU::PIDMapper& aMapper = GetPipeLine()->GetIDMapper();
+ //VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anObjId);
+ VISU::TStructuredId aVec = aMapper->GetIndexesOfNode(anObjId);
+
+ aStr << "\nCoordinates: " << "[";
+ aStr << aCoord[0];
+ //if( aVec.size() > 0 )
+ if (aVec[0] != -1)
+ aStr << " (" << aVec[0] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[1];
+ //if( aVec.size() > 1 )
+ if (aVec[1] != -1)
+ aStr << " (" << aVec[1] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[2];
+ //if( aVec.size() > 2 )
+ if (aVec[2] != -1)
+ aStr << " (" << aVec[2] << ")";
+ aStr << "]";
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ break;
+ }
+ case EdgeOfCellSelection:
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Zoom
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ double aZoomFactor = aPickingSettings->GetZoomFactor();
+ ChangeZoom(aZoomFactor,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+ }
+
+ // FlyTo
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() && aFlyTo )
+ {
+ vtkRenderWindowInteractor* anInteractor = myInteractor;
+ double aDollyWas = anInteractor->GetDolly();
+ int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
+
+ double aPosition[3];
+ GetPosition( aPosition );
+ for( int i = 0; i < 3; i++ )
+ aFlyToCoord[i] += aPosition[i];
+
+ anInteractor->SetDolly(0.0);
+ anInteractor->SetNumberOfFlyFrames(aPickingSettings->GetStepNumber());
+ anInteractor->FlyTo(aRenderer, aFlyToCoord);
+ aRenderer->ResetCameraClippingRange();
+ anInteractor->SetDolly(aDollyWas);
+ anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
+ anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aFlyToCoord);
+ }
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::ResetTextActor()
+{
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ double aCoord[6];
+ GetBounds(aCoord);
+
+ double aWorldCoord[4] = { ( aCoord[0] + aCoord[1] ) / 2,
+ ( aCoord[2] + aCoord[3] ) / 2,
+ ( aCoord[4] + aCoord[5] ) / 2, 1.0};
+ vtkRenderer* aRenderer = GetRenderer();
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ double aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ /*
+ if( const char* aName = getName() )
+ aStr << aName << "\n";
+ */
+ aStr << "Position: " << "[" << aCoord[0] << "; " << aCoord[2] << "; " << aCoord[4] << "]";
+ aStr << "\nSize: " << "[" <<
+ fabs(aCoord[1]-aCoord[0]) << "; " <<
+ fabs(aCoord[3]-aCoord[2]) << "; " <<
+ fabs(aCoord[5]-aCoord[4]) << "]";
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
+{
+ if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
+ if(VISU_Actor* self = dynamic_cast<VISU_Actor*>(anObject)) {
+ if(theEvent == VISU::UpdatePickingSettingsEvent)
+ self->UpdatePickingSettings();
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::UpdatePickingSettings()
+{
+ //printf( "VISU_Actor::UpdatePickingSettings()\n" );
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+ if( !aPickingSettings )
+ return;
+
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+
+ Highlight(isHighlighted());
+
+ Update();
+}
+
+// ---------------------------------------------------------------
+
+void VISU_Actor::SetValuesLabeled( const bool theIsValLabeled )
+{
+ vtkDataSet* aGrid = GetValLabelsInput();
+ if ( !aGrid )
+ return;
+
+ bool isOnPnt = VISU::IsDataOnPoints( aGrid );
+ bool isOnCell = VISU::IsDataOnCells( aGrid );
+ if ( !isOnPnt && !isOnCell )
+ {
+ // try to specify location of scalars "manually"
+ vtkCellData* aCData = aGrid->GetCellData();
+ if ( aCData )
+ {
+ vtkDataArray* anArr = aCData->GetScalars();
+ if ( anArr && anArr->GetNumberOfTuples() )
+ isOnCell = true;
+ }
+
+ if ( !isOnCell )
+ {
+ vtkPointData* aPData = aGrid->GetPointData();
+ if ( aPData )
+ {
+ vtkDataArray* anArr = aPData->GetScalars();
+ if ( anArr && anArr->GetNumberOfTuples() )
+ isOnPnt = true;
+ }
+ }
+
+ if ( !isOnPnt && !isOnCell )
+ {
+ myValLabels->SetVisibility( false );
+ return;
+ }
+ }
+
+ myIsValLabeled = theIsValLabeled;
+
+ if ( myIsValLabeled )
+ {
+ vtkDataSet* aDataSet = aGrid;
+
+ if ( isOnCell )
+ {
+ myValCellCenters->SetInputData( aDataSet );
+ myValMaskPoints->SetInputConnection( myValCellCenters->GetOutputPort() );
+ }
+ else if ( isOnPnt )
+ {
+ myValUsedPoints->SetInputData( aDataSet );
+ myValMaskPoints->SetInputConnection( myValUsedPoints->GetOutputPort() );
+ }
+
+ myValLabels->SetVisibility( GetVisibility() );
+ }
+ else
+ myValLabels->SetVisibility( false );
+
+ Modified();
+}
+
+//----------------------------------------------------------------------------
+
+bool VISU_Actor::GetValuesLabeled() const
+{
+ return myIsValLabeled;
+}
+
+//----------------------------------------------------------------------------
+
+vtkTextProperty* VISU_Actor::GetsValLabelsProps() const
+{
+ return myValLabeledDataMapper->GetLabelTextProperty();
+}
+
+//----------------------------------------------------------------------------
+
+vtkDataSet* VISU_Actor::GetValLabelsInput()
+{
+ vtkDataSet* aDataSet = 0;
+ VISU_PipeLine* aPL = GetPipeLine();
+ if ( aPL )
+ aDataSet = aPL->GetOutput();
+ if ( !aDataSet )
+ aDataSet = GetInput();
+ return aDataSet;
+}
+
+
+VISU_Actor::EQuadratic2DRepresentation
+VISU_Actor::GetQuadratic2DRepresentation() const
+{
+ if(Superclass::GetQuadraticArcMode()){
+ return VISU_Actor::eArcs;