smesh/src/OBJECT/SMESH_DeviceActor.h

162 lines
4.7 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
2004-06-18 14:34:31 +06:00
//
//
//
// 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 <VTKViewer_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 VTKViewer_Transform;
class VTKViewer_TransformFilter;
class VTKViewer_PassThroughFilter;
class VTKViewer_ExtractUnstructuredGrid;
2004-06-18 14:34:31 +06:00
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 vtkFloatingPointType* 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(VTKViewer_Transform* theTransform);
2004-06-18 14:34:31 +06:00
virtual unsigned long int GetMTime();
vtkFloatingPointType GetShrinkFactor();
void SetShrinkFactor(vtkFloatingPointType 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();
VTKViewer_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
2004-06-18 14:34:31 +06:00
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;
VTKViewer_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
2004-06-18 14:34:31 +06:00
bool myStoreClippingMapping;
VTKViewer_GeometryFilter *myGeomFilter;
VTKViewer_TransformFilter *myTransformFilter;
std::vector<VTKViewer_PassThroughFilter*> 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;
vtkFloatingPointType myPolygonOffsetFactor;
vtkFloatingPointType myPolygonOffsetUnits;
2004-06-18 14:34:31 +06:00
void
SetPolygonOffsetParameters(vtkFloatingPointType factor,
vtkFloatingPointType units);
void
GetPolygonOffsetParameters(vtkFloatingPointType& factor,
vtkFloatingPointType& 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