geom/src/OBJECT/GEOM_Actor.h

129 lines
3.3 KiB
C
Raw Normal View History

2003-07-09 20:44:57 +06:00
// GEOM OBJECT : interactive object for Geometry entities 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 : GEOM_Actor.h
// Author : Christophe ATTANASIO
// Module : GEOM
2003-05-12 21:09:12 +06:00
// $Header$
#ifndef GEOM_ACTOR_H
#define GEOM_ACTOR_H
#include "SALOME_Actor.h"
//OpenCASCADE
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
2004-12-01 15:39:14 +05:00
class vtkCamera;
2003-05-12 21:09:12 +06:00
class TopoDS_Shape;
2005-08-11 10:43:57 +06:00
#ifdef WNT
#include <SALOME_WNT.hxx>
2003-05-12 21:09:12 +06:00
#else
2005-08-11 10:43:57 +06:00
#define SALOME_WNT_EXPORT
2003-05-12 21:09:12 +06:00
#endif
2005-08-11 10:43:57 +06:00
class SALOME_WNT_EXPORT GEOM_Actor : public SALOME_Actor {
2003-05-12 21:09:12 +06:00
public:
vtkTypeMacro(GEOM_Actor,SALOME_Actor);
static GEOM_Actor* New();
// Description:
// This causes the actor to be rendered. It, in turn, will render the actor's
// property and then mapper.
virtual void Render(vtkRenderer *, vtkMapper *);
// Description:
// Release any graphics resources that are being consumed by this actor.
// The parameter window could be used to determine which graphic
// resources to release.
void ReleaseGraphicsResources(vtkWindow *);
const TopoDS_Shape& getTopo();
void setInputShape(const TopoDS_Shape& ashape,double adef1,int imode);
double getDeflection();
void setDeflection(double adefl);
// SubShape
void SubShapeOn();
void SubShapeOff();
// Display Mode
2004-12-01 15:39:14 +05:00
virtual void setDisplayMode(int);
2003-05-12 21:09:12 +06:00
// Highlight
2004-12-01 15:39:14 +05:00
virtual void highlight(bool theHighlight);
virtual bool hasHighlight() { return true; }
2003-05-12 21:09:12 +06:00
void ShallowCopy(vtkProp *prop);
// Properties
void SetHighlightProperty(vtkProperty* Prop);
void SetWireframeProperty(vtkProperty* Prop);
void SetShadingProperty(vtkProperty* Prop);
// Opacity
void SetOpacity(vtkFloatingPointType opa);
vtkFloatingPointType GetOpacity();
2003-05-12 21:09:12 +06:00
// Color
void SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
void GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
2004-01-28 19:08:37 +05:00
virtual bool IsInfinite() {return myIsInfinite;}
2003-05-12 21:09:12 +06:00
protected:
GEOM_Actor();
~GEOM_Actor();
GEOM_Actor(const GEOM_Actor&) {};
void operator=(const GEOM_Actor&) {};
void CreateWireframeMapper();
void CreateShadingMapper();
void CreateMapper(int theMode);
void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
private:
bool subshape;
2004-01-28 19:08:37 +05:00
bool myIsInfinite;
2003-05-12 21:09:12 +06:00
TopoDS_Shape myShape;
double deflection;
vtkMapper* ShadingMapper;
vtkMapper* WireframeMapper;
vtkProperty* ShadingProperty;
vtkProperty* WireframeProperty;
vtkProperty* HighlightProperty;
};
2004-12-01 15:39:14 +05:00
2003-05-12 21:09:12 +06:00
#endif //GEOM_ACTOR_H
2004-12-01 15:39:14 +05:00