SVTK_Recorder.h \
SVTK_RecorderDlg.h \
SVTK_ImageWriter.h \
- SVTK_ImageWriterMgr.h
+ SVTK_ImageWriterMgr.h \
+ SVTK_Utils.h
dist_libSVTK_la_SOURCES= \
SVTK_Prs.cxx \
SVTK_RecorderDlg.cxx \
SVTK_ImageWriter.cxx \
SVTK_ImageWriterMgr.cxx \
+ SVTK_Utils.cxx \
vtkPVAxesActor.h \
vtkPVAxesActor.cxx \
vtkPVAxesWidget.h \
myRenderer = theRenderer;
- theRenderer->AddActor( myPreHighlightActor.GetPointer() );
- theRenderer->AddActor( myHighlightActor.GetPointer() );
+ myHighlightActor->AddToRender(theRenderer);
+ myPreHighlightActor->AddToRender(theRenderer);
theRenderer->AddActor( myOutlineActor.GetPointer() );
theRenderer->AddActor( myNameActor.GetPointer() );
}
{
Superclass::RemoveFromRender(theRenderer);
+ myHighlightActor->RemoveFromRender(theRenderer);
+ myPreHighlightActor->RemoveFromRender(theRenderer);
+
theRenderer->RemoveActor( myPreHighlightActor.GetPointer() );
theRenderer->RemoveActor( myHighlightActor.GetPointer() );
theRenderer->RemoveActor( myOutlineActor.GetPointer() );
#include "SVTK_Actor.h"
#include "SALOME_Actor.h"
+#include "SVTK_Utils.h"
#include "SALOME_InteractiveObject.hxx"
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-static
-void
-CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet)
-{
- vtkPoints *aPoints = vtkPoints::New();
- vtkIdType iEnd = theSourceDataSet->GetNumberOfPoints();
- aPoints->SetNumberOfPoints(iEnd);
- for(vtkIdType i = 0; i < iEnd; i++){
- aPoints->SetPoint(i,theSourceDataSet->GetPoint(i));
- }
- theGrid->SetPoints(aPoints);
- aPoints->Delete();
-}
vtkStandardNewMacro(SVTK_Actor);
myUnstructuredGrid->Allocate();
vtkDataSet *aSourceDataSet = theMapActor->GetInput();
- CopyPoints(GetSource(),aSourceDataSet);
+ SVTK::CopyPoints(GetSource(),aSourceDataSet);
int aNbOfParts = theMapIndex.Extent();
for(int ind = 1; ind <= aNbOfParts; ind++){
myUnstructuredGrid->Allocate();
vtkDataSet *aSourceDataSet = theMapActor->GetInput();
- CopyPoints(GetSource(),aSourceDataSet);
+ SVTK::CopyPoints(GetSource(),aSourceDataSet);
if(theMapIndex.Extent() == 2){
myMapIndex = theMapIndex;
}
+
+/*!
+ To publish the actor an all its internal devices
+*/
+void
+SVTK_Actor
+::AddToRender(vtkRenderer* theRenderer)
+{
+ theRenderer->AddActor(this);
+}
+
+void
+SVTK_Actor
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+ theRenderer->RemoveActor(this);
+}
vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor);
//! Initialiaze the instance completely
- void
+ virtual void
Initialize();
//! Allows to set an external source
vtkUnstructuredGrid*
GetSource();
+ virtual void
+ AddToRender(vtkRenderer* theRenderer);
+
+ virtual void
+ RemoveFromRender(vtkRenderer* theRenderer);
+
+
//! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapCells(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected points from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapPoints(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
//! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes
- void
+ virtual void
MapEdge(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex);
bool SVTK_DeviceActor::IsCoincident3DAllowed() const {
return myGeomFilter->GetAppendCoincident3D();
}
+
+void
+SVTK_DeviceActor
+::SetResolveCoincidentTopology(bool theIsResolve)
+{
+ myIsResolveCoincidentTopology = theIsResolve;
+}
+
\ No newline at end of file
virtual
bool
IsCoincident3DAllowed() const;
+
+ void
+ SetResolveCoincidentTopology(bool theIsResolve);
+
protected:
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// File : SVTK_Utils.cxx
+// Author : Roman NIKOLAEV
+
+#include "SVTK_Utils.h"
+
+#include <vtkUnstructuredGrid.h>
+
+namespace SVTK {
+ void CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet)
+ {
+ vtkPoints *aPoints = vtkPoints::New();
+ vtkIdType iEnd = theSourceDataSet->GetNumberOfPoints();
+ aPoints->SetNumberOfPoints(iEnd);
+ for(vtkIdType i = 0; i < iEnd; i++){
+ aPoints->SetPoint(i,theSourceDataSet->GetPoint(i));
+ }
+ theGrid->SetPoints(aPoints);
+ aPoints->Delete();
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+// File : SVTK_Utils.h
+// Author : Roman NIKOLAEV
+
+#ifndef SVTK_UTILS_H
+#define SVTK_UTILS_H
+
+#include "SVTK.h"
+
+class vtkUnstructuredGrid;
+class vtkDataSet;
+
+namespace SVTK {
+
+ SVTK_EXPORT void CopyPoints(vtkUnstructuredGrid* theGrid, vtkDataSet *theSourceDataSet);
+
+}
+
+#endif