smesh/src/OBJECT/SMESH_DeviceActor.h

218 lines
6.6 KiB
C
Raw Normal View History

2020-04-15 19:49:00 +05:00
// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2009-02-17 10:27:49 +05:00
//
2012-08-09 16:03:55 +06:00
// 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
2014-02-20 18:25:37 +06:00
// version 2.1 of the License, or (at your option) any later version.
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// 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.
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// 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
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2004-06-18 14:34:31 +06:00
//
2012-08-09 16:03:55 +06:00
2009-02-17 10:27:49 +05:00
// SMESH OBJECT : interactive object for SMESH visualization
// File : SMESH_DeviceActor.h
2004-06-18 14:34:31 +06:00
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$
2009-02-17 10:27:49 +05:00
//
2004-06-18 14:34:31 +06:00
#ifndef SMESH_DEVICE_ACTOR_H
#define SMESH_DEVICE_ACTOR_H
#include <VTKViewer_GeometryFilter.h>
2012-08-09 16:03:55 +06:00
#include <VTKViewer_MarkerDef.h>
2004-12-01 15:48:31 +05:00
#include "SMESH_Controls.hxx"
2004-06-18 14:34:31 +06:00
#include "SMESH_Object.h"
#include <vtkLODActor.h>
2004-12-01 15:48:31 +05:00
#include <vtkSmartPointer.h>
2004-06-18 14:34:31 +06:00
2004-12-01 15:48:31 +05:00
class vtkCell;
2004-06-18 14:34:31 +06:00
class vtkProperty;
class vtkMergeFilter;
class vtkShrinkFilter;
class vtkUnstructuredGrid;
2004-12-01 15:48:31 +05:00
class vtkLookupTable;
class vtkImplicitBoolean;
class vtkPassThroughFilter;
class vtkPlaneCollection;
2004-06-18 14:34:31 +06:00
class VTKViewer_Transform;
class VTKViewer_TransformFilter;
class VTKViewer_ExtractUnstructuredGrid;
2012-08-09 16:03:55 +06:00
class VTKViewer_PolyDataMapper;
2004-06-18 14:34:31 +06:00
2004-12-01 15:48:31 +05:00
class SMESH_ExtractGeometry;
2009-02-17 10:27:49 +05:00
class SMESH_FaceOrientationFilter;
2012-08-09 16:03:55 +06:00
class SMESH_ScalarBarActor;
2004-12-01 15:48:31 +05:00
2004-06-18 14:34:31 +06:00
class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
2005-01-20 11:25:54 +05:00
friend class SMESH_ActorDef;
2004-06-18 14:34:31 +06:00
public:
2020-08-21 10:05:05 +05:00
vtkTypeMacro(SMESH_DeviceActor,vtkLODActor)
2004-06-18 14:34:31 +06:00
static SMESH_DeviceActor* New();
void SetStoreClippingMapping(bool theStoreMapping);
void SetStoreGemetryMapping(bool theStoreMapping);
void SetStoreIDMapping(bool theStoreMapping);
2004-06-18 14:34:31 +06:00
2004-12-01 15:48:31 +05:00
virtual int GetNodeObjId(int theVtkID);
2013-03-01 19:13:25 +06:00
virtual double* GetNodeCoord(int theObjID);
2017-12-19 20:56:16 +05:00
virtual int GetNodeVtkId(int theObjID);
2004-06-18 14:34:31 +06:00
2004-12-01 15:48:31 +05:00
virtual int GetElemObjId(int theVtkID);
virtual vtkCell* GetElemCell(int theObjID);
2004-06-18 14:34:31 +06:00
virtual void SetTransform(VTKViewer_Transform* theTransform);
2016-11-24 16:29:42 +05:00
virtual vtkMTimeType GetMTime();
2004-06-18 14:34:31 +06:00
2009-02-17 10:27:49 +05:00
virtual void SetFacesOriented(bool theIsFacesOriented);
virtual bool GetFacesOriented() { return myIsFacesOriented; }
2013-03-01 19:13:25 +06:00
virtual void SetFacesOrientationColor(double r,double g,double b);
virtual void GetFacesOrientationColor(double& r,double& g,double& b);
2012-08-09 16:03:55 +06:00
2013-03-01 19:13:25 +06:00
virtual void SetFacesOrientationScale(double theScale);
virtual double GetFacesOrientationScale();
2012-08-09 16:03:55 +06:00
virtual void SetFacesOrientation3DVectors(bool theState);
virtual bool GetFacesOrientation3DVectors();
//----------------------------------------------------------------------------
//! Setting for displaying quadratic elements
virtual void SetQuadraticArcMode(bool theFlag);
virtual bool GetQuadraticArcMode();
2013-03-01 19:13:25 +06:00
virtual void SetQuadraticArcAngle(double theMaxAngle);
virtual double GetQuadraticArcAngle();
2012-08-09 16:03:55 +06:00
2009-02-17 10:27:49 +05:00
void UpdateFaceOrientation();
2013-03-01 19:13:25 +06:00
double GetShrinkFactor();
void SetShrinkFactor(double value);
2004-06-18 14:34:31 +06:00
bool IsShrunkable() { return myIsShrinkable;}
bool IsShrunk() { return myIsShrunk;}
void SetShrink();
void UnShrink();
enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe};
EReperesent GetRepresentation(){ return myRepresentation;}
void SetRepresentation(EReperesent theMode);
virtual void SetVisibility(int theMode);
virtual int GetVisibility();
2009-02-17 10:27:49 +05:00
virtual void AddToRender(vtkRenderer* theRenderer);
virtual void RemoveFromRender(vtkRenderer* theRenderer);
VTKViewer_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
2004-06-18 14:34:31 +06:00
vtkUnstructuredGrid* GetUnstructuredGrid();
2004-12-01 15:48:31 +05:00
void SetPlaneCollection( vtkPlaneCollection* theCollection );
2004-12-01 15:48:31 +05:00
void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
2012-08-09 16:03:55 +06:00
SMESH_ScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable);
2005-01-20 11:25:54 +05:00
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
2012-08-09 16:03:55 +06:00
SMESH_ScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable);
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor);
2004-12-01 15:48:31 +05:00
bool IsHighlited() { return myIsHighlited;}
void SetHighlited(bool theIsHighlited);
2004-06-18 14:34:31 +06:00
2012-08-09 16:03:55 +06:00
virtual
void
SetCoincident3DAllowed(bool theIsFeatureEdgesAllowed);
virtual
bool
IsCoincident3DAllowed() const;
2004-06-18 14:34:31 +06:00
virtual void Render(vtkRenderer *, vtkMapper *);
void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
2012-08-09 16:03:55 +06:00
void SetMarkerEnabled( bool );
void SetBallEnabled( bool );
void SetBallScale( double );
2012-08-09 16:03:55 +06:00
void SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
void SetMarkerTexture( int, VTK::MarkerTexture );
VTK::MarkerType GetMarkerType();
VTK::MarkerScale GetMarkerScale();
int GetMarkerTexture();
double GetBallScale();
2012-08-09 16:03:55 +06:00
2004-06-18 14:34:31 +06:00
protected:
2004-12-01 15:48:31 +05:00
void Init(TVisualObjPtr theVisualObj, vtkImplicitBoolean* theImplicitBoolean);
2004-06-18 14:34:31 +06:00
void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
2012-08-09 16:03:55 +06:00
VTKViewer_PolyDataMapper *myMapper;
2004-06-18 14:34:31 +06:00
TVisualObjPtr myVisualObj;
vtkSmartPointer<vtkPlaneCollection> myPlaneCollection;
2004-06-18 14:34:31 +06:00
vtkProperty *myProperty;
EReperesent myRepresentation;
2004-12-01 15:48:31 +05:00
SMESH_ExtractGeometry* myExtractGeometry;
bool myIsImplicitFunctionUsed;
2004-12-01 15:48:31 +05:00
2004-06-18 14:34:31 +06:00
vtkMergeFilter* myMergeFilter;
VTKViewer_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
2004-06-18 14:34:31 +06:00
2009-02-17 10:27:49 +05:00
bool myIsFacesOriented;
SMESH_FaceOrientationFilter* myFaceOrientationFilter;
vtkPolyDataMapper* myFaceOrientationDataMapper;
vtkActor* myFaceOrientation;
bool myStoreClippingMapping;
VTKViewer_GeometryFilter *myGeomFilter;
VTKViewer_TransformFilter *myTransformFilter;
std::vector<vtkPassThroughFilter*> myPassFilter;
2004-06-18 14:34:31 +06:00
vtkShrinkFilter* myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
2004-12-01 15:48:31 +05:00
bool myIsHighlited;
2013-03-01 19:13:25 +06:00
double myPolygonOffsetFactor;
double myPolygonOffsetUnits;
2004-06-18 14:34:31 +06:00
void
2013-03-01 19:13:25 +06:00
SetPolygonOffsetParameters(double factor,
double units);
void
2013-03-01 19:13:25 +06:00
GetPolygonOffsetParameters(double& factor,
double& units)
{
2004-06-18 14:34:31 +06:00
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
}
SMESH_DeviceActor();
~SMESH_DeviceActor();
2004-12-01 15:48:31 +05:00
SMESH_DeviceActor(const SMESH_DeviceActor&);
void operator=(const SMESH_DeviceActor&);
2004-06-18 14:34:31 +06:00
};
#endif //SMESH_DEVICE_ACTOR_H