Back to index

salome-geom  6.5.0
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends
GEOM_Object Class Reference

#include <GEOM_Object.hxx>

Collaboration diagram for GEOM_Object:
Collaboration graph
[legend]

List of all members.

Classes

struct  Color

Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const
Standard_EXPORT Standard_Boolean IsKind (const Handle(Standard_Type)&AType) const
Standard_EXPORT GEOM_Object (TDF_Label &theEntry, int theType)
 Constructor: public.
Standard_EXPORT ~GEOM_Object ()
 Destructor.
Standard_EXPORT Handle (TDataStd_TreeNode) GetRootNode()
Standard_EXPORT TDF_Label GetEntry ()
Standard_EXPORT int GetType ()
 GetType.
Standard_EXPORT void SetType (int theType)
 SetType.
Standard_EXPORT int GetTic ()
 Returns modifications counter of this object.
Standard_EXPORT void SetTic (int theTic)
 Set another value of modifications counter.
Standard_EXPORT void IncrementTic ()
 Increment modifications counter to mark this object as modified.
Standard_EXPORT int GetDocID ()
 GetDocID.
Standard_EXPORT TopoDS_Shape GetValue ()
 GetValue.
Standard_EXPORT void SetName (const char *theName)
 SetName.
Standard_EXPORT char * GetName ()
 GetName.
Standard_EXPORT void SetColor (const Color &theColor)
 SetColor.
Standard_EXPORT Color GetColor ()
 GetColor.
Standard_EXPORT void SetAutoColor (bool theAutoColor)
 SetAutoColor.
Standard_EXPORT bool GetAutoColor ()
 GetAutoColor.
Standard_EXPORT void SetMarkerStd (const Aspect_TypeOfMarker theType, double theSize)
 SetMarkerStd.
Standard_EXPORT void SetMarkerTexture (int theTextureId)
 SetMarkerTexture.
Standard_EXPORT Aspect_TypeOfMarker GetMarkerType ()
 GetMarkerType.
Standard_EXPORT double GetMarkerSize ()
 GetMarkerSize.
Standard_EXPORT int GetMarkerTexture ()
 GetMarkerTexture.
Standard_EXPORT void UnsetMarker ()
 SetAuxData.
Standard_EXPORT void SetAuxData (const char *theData)
 SetAuxData.
Standard_EXPORT
TCollection_AsciiString 
GetAuxData ()
 GetAuxData.
Standard_EXPORT void SetParameters (const TCollection_AsciiString &theParameters)
 SetParameters.
Standard_EXPORT
TCollection_AsciiString 
GetParameters () const
 GetParameters.
Standard_EXPORT bool IsMainShape ()
 IsSubShape.
Standard_EXPORT void SetIOR (TCollection_AsciiString &theIOR)
Standard_EXPORT
TCollection_AsciiString 
GetIOR ()
Standard_EXPORT Handle (GEOM_Function) AddFunction(const Standard_GUID &theGUID
Standard_EXPORT int GetNbFunctions ()
 GetNbFunctions.
Standard_EXPORT Handle (GEOM_Function) GetFunction(int theFunctionNumber)
Standard_EXPORT Handle (GEOM_Function) GetLastFunction()
Standard_EXPORT Handle (TColStd_HSequenceOfTransient) GetAllDependency()
Standard_EXPORT Handle (TColStd_HSequenceOfTransient) GetLastDependency()
Standard_EXPORT TDF_Label GetFreeLabel ()
 GetFreeLabel.

Static Public Member Functions

static Standard_EXPORT Handle (GEOM_Object) GetObject(TDF_Label &theLabel)
static Standard_EXPORT Handle (GEOM_Object) GetReferencedObject(TDF_Label &theLabel)
static Standard_EXPORT const
Standard_GUID & 
GetObjectID ()
static Standard_EXPORT const
Standard_GUID & 
GetSubShapeID ()

Public Attributes

Standard_EXPORT int theFunctionType

Private Member Functions

 GEOM_Object (TDF_Label &theLabel)
 Constructor: private.
 Handle (TDataStd_TreeNode) _root

Private Attributes

TDF_Label _label
TCollection_AsciiString _ior
TCollection_AsciiString _parameters
int _docID

Friends

class GEOM_Engine
Standard_EXPORT friend
Handle_Standard_Type & 
GEOM_Object_Type_ ()

Detailed Description

Definition at line 130 of file GEOM_Object.hxx.


Class Documentation

struct GEOM_Object::Color

Definition at line 135 of file GEOM_Object.hxx.

Class Members
double B Blue component of the color.
double G Green component of the color.
double R Red component of the color.

Constructor & Destructor Documentation

GEOM_Object::GEOM_Object ( TDF_Label &  theLabel) [private]

Constructor: private.

Definition at line 150 of file GEOM_Object.cxx.

  : _label(theEntry), _ior(""), _docID(-1)
{
  Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
  if(!aDoc.IsNull()) {
    Handle(TDataStd_Integer) anID;
    if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
  }

  if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
    _root = TDataStd_TreeNode::Set(theEntry);
}

Here is the call graph for this function:

GEOM_Object::GEOM_Object ( TDF_Label &  theEntry,
int  theType 
)

Constructor: public.

Definition at line 168 of file GEOM_Object.cxx.

: _label(theEntry), _ior(""), _docID(-1)
{
  Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
  if(!aDoc.IsNull()) {
    Handle(TDataStd_Integer) anID;
    if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
  }

  theEntry.ForgetAllAttributes(Standard_True);

  if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
    _root = TDataStd_TreeNode::Set(theEntry);

  TDataStd_Integer::Set(theEntry.FindChild(TYPE_LABEL), theType);

  TDataStd_UAttribute::Set(theEntry, GetObjectID());
}

Here is the call graph for this function:

Destructor.

Definition at line 192 of file GEOM_Object.cxx.

{
  MESSAGE("GEOM_Object::~GEOM_Object()");
}

Member Function Documentation

GetAutoColor.

Definition at line 377 of file GEOM_Object.cxx.

{
  Handle(TDataStd_Integer) anAutoColor;
  if(!_label.FindChild(AUTO_COLOR_LABEL).FindAttribute(TDataStd_Integer::GetID(), anAutoColor)) return false;

  return bool(anAutoColor->Get());
}

Here is the call graph for this function:

TCollection_AsciiString GEOM_Object::GetAuxData ( )

GetAuxData.

Definition at line 490 of file GEOM_Object.cxx.

{
  TCollection_AsciiString aData;

  Handle(TDataStd_Comment) aCommentAttr;
  if (_label.FindAttribute(TDataStd_Comment::GetID(), aCommentAttr))
    aData = aCommentAttr->Get();

  return aData;
}

Here is the call graph for this function:

GetColor.

Definition at line 349 of file GEOM_Object.cxx.

{
  Handle(TDataStd_RealArray) anArray;
  bool isFound = _label.FindChild(COLOR_LABEL).FindAttribute(TDataStd_RealArray::GetID(), anArray);

  GEOM_Object::Color aColor;
  aColor.R = isFound ? anArray->Value( 1 ) : -1;
  aColor.G = isFound ? anArray->Value( 2 ) : -1;
  aColor.B = isFound ? anArray->Value( 3 ) : -1;

  return aColor;
}

Here is the call graph for this function:

GetDocID.

Definition at line 276 of file GEOM_Object.cxx.

{
  return _docID;
}

Here is the caller graph for this function:

Standard_EXPORT TDF_Label GEOM_Object::GetEntry ( ) [inline]

Definition at line 192 of file GEOM_Object.hxx.

{ return _label; }

Here is the caller graph for this function:

GetFreeLabel.

Definition at line 655 of file GEOM_Object.cxx.

{
  return _label.FindChild(FREE_LABEL);
}

Here is the caller graph for this function:

Standard_EXPORT TCollection_AsciiString GEOM_Object::GetIOR ( ) [inline]

Definition at line 274 of file GEOM_Object.hxx.

{ return _ior; }

GetMarkerSize.

Definition at line 432 of file GEOM_Object.cxx.

{
  Standard_Real aSize = 0.;
  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
  if(!aMarkerLabel.IsNull()) {
    TDF_Label aSizeLabel = aMarkerLabel.FindChild(MARKER_LABEL_SIZE, Standard_False);
    Handle(TDataStd_Real) aSizeAttr;
    if (!aSizeLabel.IsNull() && aSizeLabel.FindAttribute(TDataStd_Real::GetID(), aSizeAttr))
      aSize = aSizeAttr->Get();
  }
  return aSize;
}

Here is the call graph for this function:

GetMarkerTexture.

Definition at line 450 of file GEOM_Object.cxx.

{
  Standard_Integer anId = 0;
  if ( GetMarkerType() == Aspect_TOM_USERDEFINED) {
    TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
    if(!aMarkerLabel.IsNull()) {
      TDF_Label aTypeLabel = aMarkerLabel.FindChild(MARKER_LABEL_ID, Standard_False);
      Handle(TDataStd_Integer) anIdAttr;
      if (!aTypeLabel.IsNull() && aTypeLabel.FindAttribute(TDataStd_Integer::GetID(), anIdAttr))
        anId = anIdAttr->Get();
    }
  }
  return anId;
}

Here is the call graph for this function:

Aspect_TypeOfMarker GEOM_Object::GetMarkerType ( )

GetMarkerType.

Definition at line 414 of file GEOM_Object.cxx.

{
  Standard_Integer aType = -1;
  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL, Standard_False);
  if(!aMarkerLabel.IsNull()) {
    TDF_Label aTypeLabel = aMarkerLabel.FindChild(MARKER_LABEL_TYPE, Standard_False);
    Handle(TDataStd_Integer) aTypeAttr;
    if (!aTypeLabel.IsNull() && aTypeLabel.FindAttribute(TDataStd_Integer::GetID(), aTypeAttr))
      aType = aTypeAttr->Get();
  }
  return (Aspect_TypeOfMarker)aType;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GetName.

Definition at line 314 of file GEOM_Object.cxx.

{
  Handle(TDataStd_Name) aNameAttr;
  if(!_label.FindAttribute(TDataStd_Name::GetID(), aNameAttr)) return NULL;

  TCollection_AsciiString aName(aNameAttr->Get());
  // do not return pointer of local variable
  // return aName.ToCString();
  // the following code could lead to memory leak, so take care about recieved pointer
  return strdup(aName.ToCString());
}

Here is the call graph for this function:

GetNbFunctions.

Definition at line 566 of file GEOM_Object.cxx.

{
  Standard_Integer nb = 0;
  for(TDataStd_ChildNodeIterator CI(_root); CI.More(); CI.Next()) nb++;
  return nb;
}

Here is the caller graph for this function:

const Standard_GUID & GEOM_Object::GetObjectID ( ) [static]

Definition at line 66 of file GEOM_Object.cxx.

{
  static Standard_GUID anObjectID("FF1BBB01-5D14-4df2-980B-3A668264EA16");
  return anObjectID;
}

Here is the caller graph for this function:

TCollection_AsciiString GEOM_Object::GetParameters ( ) const

GetParameters.

Definition at line 521 of file GEOM_Object.cxx.

{
  return _parameters;
}
const Standard_GUID & GEOM_Object::GetSubShapeID ( ) [static]

Definition at line 76 of file GEOM_Object.cxx.

{
  static Standard_GUID anObjectID("FF1BBB68-5D14-4df2-980B-3A668264EA16");
  return anObjectID;
}

Here is the caller graph for this function:

Returns modifications counter of this object.

Comparing this value with modifications counters of argument objects (on which this object depends) we decide whether this object needs to be updated.

Definition at line 228 of file GEOM_Object.cxx.

{
  Handle(TDataStd_Integer) aTicAttr;
  if (!_label.FindChild(TIC_LABEL).FindAttribute(TDataStd_Integer::GetID(), aTicAttr))
    return 0;

  return aTicAttr->Get();
}

Here is the call graph for this function:

GetType.

Definition at line 202 of file GEOM_Object.cxx.

{
  Handle(TDataStd_Integer) aType;
  if(!_label.FindChild(TYPE_LABEL).FindAttribute(TDataStd_Integer::GetID(), aType)) return -1;

  return aType->Get();
}

Here is the call graph for this function:

Here is the caller graph for this function:

TopoDS_Shape GEOM_Object::GetValue ( )

GetValue.

Definition at line 287 of file GEOM_Object.cxx.

{
  TopoDS_Shape aShape;

  Handle(GEOM_Function) aFunction = GetLastFunction();

  if (!aFunction.IsNull())
    aShape = aFunction->GetValue();

  return aShape;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_EXPORT const GEOM_Object::Handle ( Standard_Type  ) const [inline]

Definition at line 161 of file GEOM_Object.hxx.

{ return STANDARD_TYPE(GEOM_Object) ; }

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_EXPORT GEOM_Object::Handle ( TDataStd_TreeNode  ) [inline]

Definition at line 189 of file GEOM_Object.hxx.

{ return _root; }
Standard_EXPORT GEOM_Object::Handle ( TColStd_HSequenceOfTransient  )
Standard_EXPORT GEOM_Object::Handle ( TColStd_HSequenceOfTransient  )
GEOM_Object::Handle ( TDataStd_TreeNode  ) [private]

Increment modifications counter to mark this object as modified.

Commonly called from GEOM_Function::SetValue()

Definition at line 258 of file GEOM_Object.cxx.

{
  TDF_Label aTicLabel = _label.FindChild(TIC_LABEL);

  Standard_Integer aTic = 0;
  Handle(TDataStd_Integer) aTicAttr;
  if (aTicLabel.FindAttribute(TDataStd_Integer::GetID(), aTicAttr))
    aTic = aTicAttr->Get();

  TDataStd_Integer::Set(aTicLabel, aTic + 1);
}

Here is the call graph for this function:

Standard_EXPORT Standard_Boolean GEOM_Object::IsKind ( const Handle(Standard_Type)&  AType) const [inline]

Definition at line 162 of file GEOM_Object.hxx.

           { return (STANDARD_TYPE(GEOM_Object) == AType || MMgt_TShared::IsKind(AType)); }

Here is the call graph for this function:

IsSubShape.

Definition at line 532 of file GEOM_Object.cxx.

{
  Handle(GEOM_Function) aFunction = GetFunction(1);
  if(aFunction.IsNull() || aFunction->GetDriverGUID() != GetSubShapeID()) return true; // mkr : IPAL9921
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GEOM_Object::operator delete ( void *  anAddress) [inline]

Definition at line 153 of file GEOM_Object.hxx.

    {
      if (anAddress) Standard::Free((Standard_Address&)anAddress);
    }
void* GEOM_Object::operator new ( size_t  ,
void *  anAddress 
) [inline]

Definition at line 145 of file GEOM_Object.hxx.

    {
      return anAddress;
    }
void* GEOM_Object::operator new ( size_t  size) [inline]

Definition at line 149 of file GEOM_Object.hxx.

    {
      return Standard::Allocate(size);
    }
void GEOM_Object::SetAutoColor ( bool  theAutoColor)

SetAutoColor.

Definition at line 367 of file GEOM_Object.cxx.

{
  TDataStd_Integer::Set(_label.FindChild(AUTO_COLOR_LABEL), (int)theAutoColor);
}
void GEOM_Object::SetAuxData ( const char *  theData)

SetAuxData.

Definition at line 480 of file GEOM_Object.cxx.

{
  TDataStd_Comment::Set(_label, (char*)theData);
}
void GEOM_Object::SetColor ( const Color theColor)

SetColor.

Definition at line 331 of file GEOM_Object.cxx.

{
  Handle(TDataStd_RealArray) anArray = new TDataStd_RealArray();
  anArray->Init( 1, 3 );
  anArray->SetValue( 1, theColor.R );
  anArray->SetValue( 2, theColor.G );
  anArray->SetValue( 3, theColor.B );

  Handle(TDataStd_RealArray) anAttr =
    TDataStd_RealArray::Set(_label.FindChild(COLOR_LABEL), anArray->Lower(), anArray->Upper());
  anAttr->ChangeArray(anArray->Array());
}

Here is the call graph for this function:

Standard_EXPORT void GEOM_Object::SetIOR ( TCollection_AsciiString &  theIOR) [inline]

Definition at line 271 of file GEOM_Object.hxx.

{ _ior = theIOR; }
void GEOM_Object::SetMarkerStd ( const Aspect_TypeOfMarker  theType,
double  theSize 
)

SetMarkerStd.

Definition at line 390 of file GEOM_Object.cxx.

{
  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL);
  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_TYPE), (int)theType);
  TDataStd_Real::Set(aMarkerLabel.FindChild(MARKER_LABEL_SIZE), theSize);
}

Here is the caller graph for this function:

void GEOM_Object::SetMarkerTexture ( int  theTextureId)

SetMarkerTexture.

Definition at line 402 of file GEOM_Object.cxx.

{
  TDF_Label aMarkerLabel = _label.FindChild(MARKER_LABEL);
  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_TYPE), (int)Aspect_TOM_USERDEFINED);
  TDataStd_Integer::Set(aMarkerLabel.FindChild(MARKER_LABEL_ID),   theTextureId);
}
void GEOM_Object::SetName ( const char *  theName)

SetName.

Definition at line 304 of file GEOM_Object.cxx.

{
  TDataStd_Name::Set(_label, (char*)theName);
}
void GEOM_Object::SetParameters ( const TCollection_AsciiString &  theParameters)

SetParameters.

Definition at line 506 of file GEOM_Object.cxx.

{
  if( _parameters.IsEmpty() )
    _parameters = theParameters;
  else {
    _parameters += "|";
    _parameters += theParameters;
  }
}
void GEOM_Object::SetTic ( int  theTic)

Set another value of modifications counter.

Use this method to update modifications counter of dependent object to be equal to modifications counter of its argument. This is commonly done in GEOM_Function::GetValue()

Definition at line 246 of file GEOM_Object.cxx.

{
  TDataStd_Integer::Set(_label.FindChild(TIC_LABEL), theTic);
}

Here is the caller graph for this function:

void GEOM_Object::SetType ( int  theType)

SetType.

Definition at line 215 of file GEOM_Object.cxx.

{
  TDataStd_Integer::Set(_label.FindChild(TYPE_LABEL), theType);
}

SetAuxData.

Definition at line 470 of file GEOM_Object.cxx.

{
  SetMarkerStd((Aspect_TypeOfMarker)-1, 0.);
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class GEOM_Engine [friend]

Definition at line 132 of file GEOM_Object.hxx.

Standard_EXPORT friend Handle_Standard_Type& GEOM_Object_Type_ ( ) [friend]

Definition at line 664 of file GEOM_Object.cxx.

{

  static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared);
  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared);
  static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient);
  if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient);


  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
  static Handle_Standard_Type _aType = new Standard_Type("GEOM_Object",
                                                         sizeof(GEOM_Object),
                                                         1,
                                                         (Standard_Address)_Ancestors,
                                                         (Standard_Address)NULL);
  return _aType;
}

Member Data Documentation

int GEOM_Object::_docID [private]

Definition at line 311 of file GEOM_Object.hxx.

TCollection_AsciiString GEOM_Object::_ior [private]

Definition at line 309 of file GEOM_Object.hxx.

TDF_Label GEOM_Object::_label [private]

Definition at line 308 of file GEOM_Object.hxx.

TCollection_AsciiString GEOM_Object::_parameters [private]

Definition at line 310 of file GEOM_Object.hxx.

Definition at line 282 of file GEOM_Object.hxx.


The documentation for this class was generated from the following files: