// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <TNaming_NamedShape.ixx>
-#include <TNaming_Builder.ixx>
-#include <TDF_Label.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <gp_Pnt.hxx>
+#include <Standard.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <Standard_GUID.hxx>
+#include <Standard_NoMoreObject.hxx>
+#include <Standard_NoSuchObject.hxx>
+#include <Standard_NullObject.hxx>
+#include <Standard_Type.hxx>
+#include <TDF_Attribute.hxx>
+#include <TDF_AttributeDelta.hxx>
+#include <TDF_AttributeIterator.hxx>
#include <TDF_Data.hxx>
+#include <TDF_DataSet.hxx>
#include <TDF_DeltaOnAddition.hxx>
-#include <TDF_AttributeIterator.hxx>
-#include <TNaming_PtrNode.hxx>
-#include <TNaming_PtrRefShape.hxx>
-#include <TNaming_RefShape.hxx>
-#include <TNaming_UsedShapes.hxx>
-#include <TNaming_Tool.hxx>
+#include <TDF_DeltaOnModification.hxx>
+#include <TDF_DeltaOnRemoval.hxx>
+#include <TDF_Label.hxx>
+#include <TDF_RelocationTable.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_CopyShape.hxx>
+#include <TNaming_DeltaOnModification.hxx>
+#include <TNaming_DeltaOnRemoval.hxx>
#include <TNaming_Iterator.hxx>
+#include <TNaming_NamedShape.hxx>
#include <TNaming_NewShapeIterator.hxx>
#include <TNaming_OldShapeIterator.hxx>
+#include <TNaming_PtrNode.hxx>
+#include <TNaming_PtrRefShape.hxx>
+#include <TNaming_RefShape.hxx>
#include <TNaming_SameShapeIterator.hxx>
-
-#include <TNaming_DeltaOnModification.hxx>
-#include <TNaming_DeltaOnRemoval.hxx>
-#include <Standard_NoMoreObject.hxx>
-#include <Standard_NoSuchObject.hxx>
-#include <Standard_ConstructionError.hxx>
-#include <Standard_NullObject.hxx>
-
-#include <gp_Pnt.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <TNaming_Tool.hxx>
+#include <TNaming_UsedShapes.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
-// Defines the nodes classes
-
-#include <Standard.hxx>
-#include <TNaming_CopyShape.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(TNaming_NamedShape,TDF_Attribute)
+// Defines the nodes classes
//#define MDTV_DEB_HASL
//=======================================================================
//function : GetID
//purpose :
//=======================================================================
-
const Standard_GUID& TNaming_NamedShape::GetID()
{
static Standard_GUID TNaming_NamedShapeID("c4ef4200-568f-11d1-8940-080009dc3333");
(const Handle(TDF_Attribute)& anOldAttribute) const
{
- return new TNaming_DeltaOnModification(*((Handle(TNaming_NamedShape)*)&anOldAttribute));
+ return new TNaming_DeltaOnModification(Handle(TNaming_NamedShape)::DownCast (anOldAttribute));
}
//=======================================================================
const Standard_Integer Trans)
:myTrans(Trans)
{
- Handle(TNaming_NamedShape) Att;
+ Handle(TDF_Attribute) Att;
if (Lab.FindAttribute(TNaming_NamedShape::GetID(),Trans,Att)) {
- myNode = Att->myNode;
+ myNode = Handle(TNaming_NamedShape)::DownCast (Att)->myNode;
}
else {
myNode = 0L;
const Standard_Integer Trans,
const Handle(TNaming_UsedShapes)& Shapes)
:myTrans(Trans)
-{
- Standard_Boolean Old = Standard_True;
- TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
+{
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator aShape");
+ TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
:myTrans(Trans)
{
Handle(TNaming_UsedShapes) Shapes;
- if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
- Standard_Boolean Old = Standard_True;
- TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
+ if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator aShape");
+ TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
TNaming_NewShapeIterator::TNaming_NewShapeIterator (const TNaming_Iterator& anIterator)
:myTrans(anIterator.myTrans)
{
- Standard_Boolean Old = Standard_True;
- myNode = anIterator.myNode;
+ Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L,
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator");
+ myNode = anIterator.myNode;
TNaming_RefShape* RS = myNode->myNew;
if (RS == 0L)
myNode = 0L; // No descendant
else {
// il faut repartir de la premiere utilisation.
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
const Handle(TNaming_UsedShapes)& Shapes)
:myTrans(-1)
{
- Standard_Boolean Old = Standard_True;
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator aShape");
TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
{
Handle(TNaming_UsedShapes) Shapes;
if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
- Standard_Boolean Old = Standard_True;
- TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator aShape");
+ Standard_Boolean Old(Standard_True);
+ TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
SelectSameShape(myNode,Old,RS,myTrans);
}
TNaming_NewShapeIterator::TNaming_NewShapeIterator(const TNaming_NewShapeIterator& anIterator)
:myTrans(anIterator.myTrans)
{
- Standard_Boolean Old = Standard_True;
+ Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L,
+ "TNaming_NewShapeIterator::TNaming_NewShapeIterator");
myNode = anIterator.myNode;
TNaming_RefShape* RS = myNode->myNew;
if (RS == 0L)
else {
// il faut repartir de la premiere utilisation.
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
void TNaming_NewShapeIterator::Next()
{
- Standard_Boolean Old = Standard_True;
TNaming_RefShape* RS = myNode->myOld;
myNode = myNode->NextSameShape(RS);
+ Standard_Boolean Old(Standard_True);
SelectSameShape(myNode,Old,RS,myTrans);
}
const Handle(TNaming_UsedShapes)& Shapes)
:myTrans(Trans)
{
- Standard_Boolean Old = Standard_False;
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator aShape");
TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
{
Handle(TNaming_UsedShapes) Shapes;
if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
- Standard_Boolean Old = Standard_False;
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator aShape");
TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
const Handle(TNaming_UsedShapes)& Shapes)
:myTrans(-1)
{
- Standard_Boolean Old = Standard_False;
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator aShape");
TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
:myTrans(-1)
{
Handle(TNaming_UsedShapes) Shapes;
- if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
- Standard_Boolean Old = Standard_False;
+ if (access.Root().FindAttribute(TNaming_UsedShapes::GetID(),Shapes)) {
+ Standard_NoSuchObject_Raise_if(!Shapes->Map().IsBound(aShape),
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator aShape");
TNaming_RefShape* RS = Shapes->Map().ChangeFind(aShape);
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
TNaming_OldShapeIterator::TNaming_OldShapeIterator (const TNaming_Iterator& anIterator)
:myTrans(anIterator.myTrans)
{
- Standard_Boolean Old = Standard_False;
- myNode = anIterator.myNode;
+ Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L,
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator");
+ myNode = anIterator.myNode;
TNaming_RefShape* RS = myNode->myNew;
if (RS == 0L)
myNode = 0L; // No descendant
else {
// il faut repartir de la premiere utilisation.
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
}
TNaming_OldShapeIterator::TNaming_OldShapeIterator(const TNaming_OldShapeIterator& anIterator)
:myTrans(anIterator.myTrans)
{
- Standard_Boolean Old = Standard_False;
- myNode = anIterator.myNode;
+ Standard_NoSuchObject_Raise_if(anIterator.myNode == 0L,
+ "TNaming_OldShapeIterator::TNaming_OldShapeIterator");
+ myNode = anIterator.myNode;
TNaming_RefShape* RS = myNode->myOld;
if (RS == 0L)
myNode = 0L; // No descendant
else {
// il faut repartir de la premiere utilisation.
myNode = RS->FirstUse();
+ Standard_Boolean Old(Standard_False);
SelectSameShape(myNode,Old,RS,myTrans);
}
}