2015-02-10 14:25:19 +05:00
|
|
|
// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
|
2008-03-07 12:45:34 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2008-03-07 12:45:34 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +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-18 12:44:41 +06:00
|
|
|
// version 2.1 of the License, or (at your option) any later version.
|
2005-12-05 21:23:52 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +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.
|
2005-12-05 21:23:52 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +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
|
2009-02-13 17:16:39 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2005-12-05 21:23:52 +05:00
|
|
|
//
|
2012-08-09 13:58:02 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
#ifndef _GEOM_Object_HeaderFile
|
|
|
|
#define _GEOM_Object_HeaderFile
|
|
|
|
|
2013-09-30 17:45:32 +06:00
|
|
|
#include "GEOM_BaseObject.hxx"
|
|
|
|
|
|
|
|
#include <Aspect_TypeOfMarker.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <Standard_GUID.hxx>
|
2014-10-14 22:45:17 +06:00
|
|
|
#include <TColStd_HSequenceOfTransient.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <TDF_Label.hxx>
|
2013-09-30 17:45:32 +06:00
|
|
|
#include <TopoDS_Shape.hxx>
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2014-10-14 22:45:17 +06:00
|
|
|
#include <list>
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
class GEOM_Object;
|
2013-06-17 18:19:23 +06:00
|
|
|
class Handle(TFunction_Driver);
|
2013-09-30 17:45:32 +06:00
|
|
|
class GEOM_Engine;
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2013-09-30 17:45:32 +06:00
|
|
|
DEFINE_STANDARD_HANDLE( GEOM_Object, GEOM_BaseObject );
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2013-09-30 17:45:32 +06:00
|
|
|
class GEOM_Object : public GEOM_BaseObject
|
2004-12-01 15:39:14 +05:00
|
|
|
{
|
2008-03-07 12:45:34 +05:00
|
|
|
friend class GEOM_Engine;
|
2012-08-09 13:58:02 +06:00
|
|
|
|
|
|
|
public:
|
|
|
|
struct Color {
|
|
|
|
//! Red component of the color
|
|
|
|
double R;
|
|
|
|
//! Green component of the color
|
|
|
|
double G;
|
|
|
|
//! Blue component of the color
|
|
|
|
double B;
|
|
|
|
};
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
private:
|
2008-03-07 12:45:34 +05:00
|
|
|
GEOM_Object(TDF_Label& theLabel);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
public:
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT GEOM_Object(TDF_Label& theEntry, int theType);
|
2012-08-09 13:58:02 +06:00
|
|
|
Standard_EXPORT ~GEOM_Object();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Finds a GEOM_Object on the label theLabel
|
2014-10-14 22:45:17 +06:00
|
|
|
Standard_EXPORT static Handle(GEOM_Object) GetObject(const TDF_Label& theLabel);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Finds a GEOM_Object by a reference, stored on the label theLabel
|
2014-10-14 22:45:17 +06:00
|
|
|
Standard_EXPORT static Handle(GEOM_Object) GetReferencedObject(const TDF_Label& theLabel);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//###########################################################
|
2008-03-07 12:45:34 +05:00
|
|
|
//Access to properties
|
2004-12-01 15:39:14 +05:00
|
|
|
//###########################################################
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
//Returns a value (as TopoDS_Shape) of this GEOM_Object
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT TopoDS_Shape GetValue();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
//Sets a color of this GEOM_Object
|
2012-08-09 13:58:02 +06:00
|
|
|
Standard_EXPORT void SetColor(const Color& theColor);
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
//Returns a color of this GEOM_Object
|
2012-08-09 13:58:02 +06:00
|
|
|
Standard_EXPORT Color GetColor();
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
//Toggles an auto color mode on this GEOM_Object
|
2012-08-09 13:58:02 +06:00
|
|
|
Standard_EXPORT void SetAutoColor(bool theAutoColor);
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
//Returns a flag of auto color mode of this GEOM_Object
|
2012-08-09 13:58:02 +06:00
|
|
|
Standard_EXPORT bool GetAutoColor();
|
|
|
|
|
|
|
|
//Sets predefined point marker texture
|
|
|
|
Standard_EXPORT void SetMarkerStd(const Aspect_TypeOfMarker theType, double theSize);
|
|
|
|
|
|
|
|
//Sets custom point marker texture
|
|
|
|
Standard_EXPORT void SetMarkerTexture(int theTextureId);
|
|
|
|
|
|
|
|
//Gets point marker type
|
|
|
|
Standard_EXPORT Aspect_TypeOfMarker GetMarkerType();
|
|
|
|
|
|
|
|
//Gets point marker scale factor / size
|
|
|
|
Standard_EXPORT double GetMarkerSize();
|
|
|
|
|
|
|
|
//Gets custom marker texture ID
|
|
|
|
Standard_EXPORT int GetMarkerTexture();
|
|
|
|
|
|
|
|
//Unsets point marker
|
|
|
|
Standard_EXPORT void UnsetMarker();
|
2008-03-07 12:45:34 +05:00
|
|
|
|
|
|
|
//###########################################################
|
2012-08-09 13:58:02 +06:00
|
|
|
// Sub-shape methods
|
2004-12-01 15:39:14 +05:00
|
|
|
//###########################################################
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2012-08-09 13:58:02 +06:00
|
|
|
//Returns false if the object is a sub-shape of another object
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT bool IsMainShape();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2014-10-14 22:45:17 +06:00
|
|
|
//Comfort method
|
|
|
|
Standard_EXPORT static Handle(TColStd_HSequenceOfTransient)
|
|
|
|
GetLastFunctions( const std::list< Handle(GEOM_Object) >& theObjects );
|
|
|
|
|
2013-09-30 17:45:32 +06:00
|
|
|
public:
|
|
|
|
DEFINE_STANDARD_RTTI( GEOM_Object );
|
2004-12-01 15:39:14 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|