-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// File : GEOM_Actor.h
// Author : Christophe ATTANASIO
// Module : GEOM
-// $Header$
//
#ifndef GEOM_ACTOR_H
#define GEOM_ACTOR_H
typedef GEOM_SmartPtr<GEOM_ShadingFace> PSFaceSource;
class vtkRenderer;
+class vtkTextActor;
class vtkAppendPolyData;
typedef GEOM_SmartPtr<vtkAppendPolyData> PAppendFilter;
class GEOM_OBJECT_EXPORT GEOM_Actor: public SALOME_Actor
{
public:
- vtkTypeMacro(GEOM_Actor,SALOME_Actor);
+ vtkTypeMacro(GEOM_Actor,SALOME_Actor)
static GEOM_Actor* New();
void SetShape(const TopoDS_Shape& theShape,
- float theDeflection,
- bool theIsVector = false);
+ double theDeflection,
+ bool theIsVector = false);
- void SetDeflection(float theDeflection);
- float GetDeflection() const{ return myDeflection;}
+ void SetDeflection(double theDeflection);
+ double GetDeflection() const{ return myDeflection;}
void AddToRender(vtkRenderer* theRenderer);
void RemoveFromRender(vtkRenderer* theRenderer);
vtkProperty* GetWireframeProperty();
vtkProperty* GetShadingProperty();
+ vtkProperty* GetIsolatedEdgeProperty();
+ vtkProperty* GetVertexProperty();
+ vtkProperty* GetStandaloneVertexProperty();
+ vtkProperty* GetSharedEdgeProperty();
+ vtkProperty* GetFaceEdgeProperty();
- void setDeflection(double adef);
virtual void setDisplayMode(int thenewmode);
// Description:
const TopoDS_Shape& getTopo();
void setInputShape(const TopoDS_Shape& ashape, double adef1,
int imode, bool isVector = false);
- double getDeflection();
double isVector();
// SubShape
void ShallowCopy(vtkProp *prop);
// Opacity
- void SetOpacity(vtkFloatingPointType opa);
- vtkFloatingPointType GetOpacity();
+ void SetOpacity(double opa);
+ double GetOpacity();
+
+ // Color (same to all sub-actors/display modes)
+ void SetColor(double r, double g, double b);
+ void GetColor(double& r, double& g, double& b);
+ // Color of points
+ void SetPointColor(double r, double g, double b);
+ // Color of standalone edges, wires, vectors
+ void SetIsolatedEdgeColor(double r, double g, double b);
+ // Color of shared edges
+ void SetSharedEdgeColor(double r, double g, double b);
+ // Color of free edges
+ void SetFreeEdgeColor(double r, double g, double b);
+ // Color of edges in shading+edges display mode
+ void SetEdgesInShadingColor(double r, double g, double b);
+ // Color of iso-lines
+ void SetIsosColor(double r, double g, double b);
+ // Color of labels
+ void SetLabelColor(double r, double g, double b);
- // Color
- void SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
- void GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
// Material
void SetMaterial(std::vector<vtkProperty*> theProps);
- vtkProperty* GetMaterial();
-
+ vtkProperty* GetFrontMaterial();
+ vtkProperty* GetBackMaterial();
virtual bool IsInfinitive();
// overloaded functions
virtual
bool
GetVectorMode();
-
- //! Edges in shading color management
- void SetEdgesInShadingColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
+ //! Vertices mode management
+ virtual
void
- StoreIsoNumbers();
+ SetVerticesMode(const bool theMode);
+ virtual
+ bool
+ GetVerticesMode();
+
+ //! Name mode management
+ virtual
void
- RestoreIsoNumbers();
-
- void
- ResetIsoNumbers();
+ SetNameMode(const bool theMode);
+
+ virtual
+ bool
+ GetNameMode();
+
+ virtual
+ void
+ SetTransform(VTKViewer_Transform* theTransform);
+
protected:
void SetModified();
void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
-
- void StoreBoundaryColors();
- void RestoreBoundaryColors();
+ void SetShapeName();
GEOM_Actor();
~GEOM_Actor();
private:
TopoDS_Shape myShape;
- int myNbIsos[2];
bool isOnlyVertex;
- float myDeflection;
+ double myDeflection;
bool myIsForced;
// EDisplayMode myDisplayMode;
bool myIsSelected;
bool myVectorMode;
+ bool myVerticesMode;
+ bool myNameMode;
PDeviceActor myVertexActor;
PVertexSource myVertexSource;
+ PDeviceActor myStandaloneVertexActor;
+ PVertexSource myStandaloneVertexSource;
+
PDeviceActor myIsolatedEdgeActor;
PEdgeSource myIsolatedEdgeSource;
PSFaceSource myShadingFaceSource;
PDeviceActor myHighlightActor;
+
+ vtkTextActor* myTextActor;
+
vtkSmartPointer<vtkProperty> myHighlightProp;
vtkSmartPointer<vtkProperty> myPreHighlightProp;
vtkSmartPointer<vtkProperty> myShadingFaceProp;
+ vtkSmartPointer<vtkProperty> myShadingBackFaceProp;
PAppendFilter myAppendFilter;
PPolyGeomPainterDataMapper myPolyDataMapper;
GEOM_Actor(const GEOM_Actor&);
void operator=(const GEOM_Actor&);
- vtkFloatingPointType myEdgesInWireframeColor[3];
- vtkFloatingPointType myEdgesInShadingColor[3];
+ double myEdgesInWireframeColor[3];
+ double myEdgesInShadingColor[3];
+ double myIsolatedEdgeColor[3];
+ double mySharedEdgeColor[3];
+ double myOneFaceEdgeColor[3];
};
#endif //GEOM_ACTOR_H