X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_DeviceActor.h;h=95c13743f0472200d1e077059616564b5e34b4de;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=f8a49bc36316937a3669c5542f9fa035ec54332b;hpb=9f1a66957ba9a2308f8fdc3f9397140af9df5fd0;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index f8a49bc36..95c13743f 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -1,34 +1,37 @@ -// SVTK OBJECT : interactive object for SVTK visualization +// Copyright (C) 2007-2016 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, or (at your option) any later version. // -// Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// 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 // + +// SVTK OBJECT : interactive object for SVTK visualization // File : SVTK_DeviceActor.h // Author : -// Module : -// $Header$ #ifndef SVTK_DEVICE_ACTOR_H #define SVTK_DEVICE_ACTOR_H +#include "SVTK.h" +#include "VTKViewer.h" +#include "VTKViewer_Actor.h" +#include "VTKViewer_MarkerDef.h" + #include #include @@ -36,30 +39,21 @@ class VTKViewer_Transform; class VTKViewer_TransformFilter; -class VTKViewer_PassThroughFilter; class VTKViewer_GeometryFilter; class vtkCell; class vtkDataSet; class vtkShrinkFilter; -class vtkDataSetMapper; +class vtkFeatureEdges; +class VTKViewer_DataSetMapper; +class vtkPassThroughFilter; +class vtkAlgorithmOutput; -//---------------------------------------------------------------------------- -namespace SVTK -{ - namespace Representation - { - typedef int Type; - const Type Points = VTK_POINTS; - const Type Wireframe = VTK_WIREFRAME; - const Type Surface = VTK_SURFACE; - const Type Insideframe = Surface + 1; - } -} - - -//---------------------------------------------------------------------------- -class SVTK_DeviceActor: public vtkLODActor +#ifdef WIN32 +#pragma warning ( disable:4251 ) +#endif + +class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor { public: vtkTypeMacro(SVTK_DeviceActor,vtkLODActor); @@ -86,7 +80,12 @@ class SVTK_DeviceActor: public vtkLODActor //! Allows to set initial #vtkDataSet virtual void - SetInput(vtkDataSet* theDataSet); + SetInputData(vtkDataSet* theDataSet); + + //! Allows to set initial #vtkAlgorithmOutput + virtual + void + SetInputConnection(vtkAlgorithmOutput* theAlgorithmOutput); /** @name For selection mapping purpose */ //@{ @@ -95,7 +94,7 @@ class SVTK_DeviceActor: public vtkLODActor GetNodeObjId(int theVtkID); virtual - float* + double* GetNodeCoord(int theObjID); virtual @@ -113,17 +112,17 @@ class SVTK_DeviceActor: public vtkLODActor //@} virtual - unsigned long int + vtkMTimeType GetMTime(); /** @name For shrink mamnagement purpose */ //@{ - float + double GetShrinkFactor(); virtual void - SetShrinkFactor(float value); + SetShrinkFactor(double value); virtual void @@ -144,20 +143,68 @@ class SVTK_DeviceActor: public vtkLODActor UnShrink(); //@} + /** @name For feature edges management purpose */ + //@{ + virtual + bool + IsFeatureEdgesAllowed(); + + virtual + void + SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed); + + virtual + bool + IsFeatureEdgesEnabled(); + + virtual + void + SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled); + + virtual + double + GetFeatureEdgesAngle(); + + virtual + void + SetFeatureEdgesAngle(double theAngle); + + 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); + //@} + /** @name For representation mamnagement purpose */ virtual void - SetRepresentation(SVTK::Representation::Type theMode); + SetRepresentation(VTKViewer::Representation::Type theMode); - SVTK::Representation::Type + VTKViewer::Representation::Type GetRepresentation(); virtual - float + double GetDefaultPointSize(); virtual - float + double GetDefaultLineWidth(); bool @@ -167,12 +214,62 @@ class SVTK_DeviceActor: public vtkLODActor SetShaded(bool theShaded); //@} + /** @name For ball marker management purpose */ + void + SetBallEnabled( bool ); + + /** @name For marker management purpose */ + void + SetMarkerEnabled( bool ); + + void + SetBallScale( double ); + + void + SetMarkerStd( VTK::MarkerType, VTK::MarkerScale ); + + void + SetMarkerTexture( int, VTK::MarkerTexture ); + + VTK::MarkerType + GetMarkerType(); + + VTK::MarkerScale + GetMarkerScale(); + + int + GetMarkerTexture(); + //@} + virtual void Render(vtkRenderer *, vtkMapper *); + VTKViewer_DataSetMapper* GetDataSetMapper(); + + //---------------------------------------------------------------------------- + //! Setting for displaying quadratic elements + virtual void SetQuadraticArcMode(bool theFlag); + virtual bool GetQuadraticArcMode(); + + virtual void SetQuadraticArcAngle(double theMaxAngle); + virtual double GetQuadraticArcAngle(); + + virtual + void + SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed); + + virtual + bool + IsCoincident3DAllowed() const; + + void + SetResolveCoincidentTopology(bool theIsResolve); + + + protected: - SVTK::Representation::Type myRepresentation; + VTKViewer::Representation::Type myRepresentation; vtkProperty *myProperty; bool myIsShaded; @@ -182,19 +279,25 @@ class SVTK_DeviceActor: public vtkLODActor VTKViewer_GeometryFilter *myGeomFilter; VTKViewer_TransformFilter *myTransformFilter; - std::vector myPassFilter; + std::vector myPassFilter; vtkShrinkFilter* myShrinkFilter; - vtkDataSetMapper* myMapper; + vtkFeatureEdges* myFeatureEdges; + VTKViewer_DataSetMapper* myMapper; bool myIsShrinkable; bool myIsShrunk; + bool myIsFeatureEdgesAllowed; + bool myIsFeatureEdgesEnabled; + bool myIsResolveCoincidentTopology; - float myPolygonOffsetFactor; - float myPolygonOffsetUnits; + double myPolygonOffsetFactor; + double myPolygonOffsetUnits; - void SetPolygonOffsetParameters(float factor, float units); - void GetPolygonOffsetParameters(float& factor, float& units); + void SetPolygonOffsetParameters(double factor, + double units); + void GetPolygonOffsetParameters(double& factor, + double& units); SVTK_DeviceActor(); ~SVTK_DeviceActor(); @@ -205,5 +308,8 @@ class SVTK_DeviceActor: public vtkLODActor }; +#ifdef WIN32 +#pragma warning ( default:4251 ) +#endif #endif //SVTK_DEVICE_ACTOR_H