smesh/src/OBJECT/SMESH_DeviceActor.h

156 lines
4.5 KiB
C
Raw Normal View History

2004-06-18 14:34:31 +06:00
// SMESH OBJECT : interactive object for SMESH visualization
//
// 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
//
//
//
// File : SMESH_DeviceActor.h
2004-06-18 14:34:31 +06:00
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$
#ifndef SMESH_DEVICE_ACTOR_H
#define SMESH_DEVICE_ACTOR_H
#include "SALOME_GeometryFilter.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 vtkPolyDataMapper;
class vtkUnstructuredGrid;
2004-12-01 15:48:31 +05:00
class vtkScalarBarActor;
class vtkLookupTable;
class vtkImplicitBoolean;
2004-06-18 14:34:31 +06:00
class SALOME_Transform;
class SALOME_TransformFilter;
class SALOME_PassThroughFilter;
class SALOME_ExtractUnstructuredGrid;
2004-12-01 15:48:31 +05:00
class SMESH_ExtractGeometry;
2004-06-18 14:34:31 +06:00
class 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:
vtkTypeMacro(SMESH_DeviceActor,vtkLODActor);
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);
virtual float* GetNodeCoord(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(SALOME_Transform* theTransform);
virtual unsigned long int GetMTime();
float GetShrinkFactor();
void SetShrinkFactor(float value);
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();
SALOME_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
vtkUnstructuredGrid* GetUnstructuredGrid();
2004-12-01 15:48:31 +05:00
void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
vtkScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable);
2005-01-20 11:25:54 +05:00
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
vtkScalarBarActor* 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
virtual void Render(vtkRenderer *, vtkMapper *);
void SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed);
bool IsImplicitFunctionUsed() const{ return myIsImplicitFunctionUsed;}
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);
vtkPolyDataMapper *myMapper;
TVisualObjPtr myVisualObj;
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;
SALOME_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
bool myStoreClippingMapping;
2004-06-18 14:34:31 +06:00
SALOME_GeometryFilter *myGeomFilter;
SALOME_TransformFilter *myTransformFilter;
std::vector<SALOME_PassThroughFilter*> myPassFilter;
vtkShrinkFilter* myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
2004-12-01 15:48:31 +05:00
bool myIsHighlited;
2004-06-18 14:34:31 +06:00
float myPolygonOffsetFactor;
float myPolygonOffsetUnits;
void SetPolygonOffsetParameters(float factor, float units);
void GetPolygonOffsetParameters(float& factor, float& units){
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