-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
static
void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
+static
+ void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD);
static
void DumpPosition(const gp_Ax3& aAx3);
static
//function :
//purpose :
//=======================================================================
- GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
{
Reset();
}
//function : ~
//purpose :
//=======================================================================
- GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
{
}
//=======================================================================
//function : Reset
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::Reset()
+void GEOMAlgo_ShapeInfo::Reset()
{
Standard_Integer i;
//
myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
myKindOfName=GEOMAlgo_KN_UNKNOWN;
+ myKindOfDef=GEOMAlgo_KD_UNKNOWN;
//
myLocation.SetCoord(99., 99., 99.);
myDirection.SetCoord(1.,0.,0.);
//function : SetType
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
+void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
{
myType=aType;
}
//function : Type
//purpose :
//=======================================================================
- TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
+TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
{
return myType;
}
//function : SetNbSubShapes
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
- const Standard_Integer aNb)
+void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
+ const Standard_Integer aNb)
{
Standard_Integer iN;
//function : NbSubShapes
//purpose :
//=======================================================================
- Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
+Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes
+ (const TopAbs_ShapeEnum aType) const
{
Standard_Integer iN;
//function : SetKindOfShape
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
+void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
{
myKindOfShape=aT;
}
//function : KindOfShape
//purpose :
//=======================================================================
- GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
+GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
{
return myKindOfShape;
}
//function : SetKindOfName
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
+void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
{
myKindOfName=aT;
}
//function : KindOfName
//purpose :
//=======================================================================
- GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
+GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
{
return myKindOfName;
}
//function : SetKindOfBounds
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
+void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
{
myKindOfBounds=aT;
}
//function : KindOfBounds
//purpose :
//=======================================================================
- GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
+GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
{
return myKindOfBounds;
}
//function : SetKindOfClosed
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
+void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
{
myKindOfClosed=aT;
}
//function : KindOfClosed
//purpose :
//=======================================================================
- GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
+GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
{
return myKindOfClosed;
}
//=======================================================================
+//function : SetKindOfDef
+//purpose :
+//=======================================================================
+void GEOMAlgo_ShapeInfo::SetKindOfDef(const GEOMAlgo_KindOfDef aT)
+{
+ myKindOfDef=aT;
+}
+//=======================================================================
+//function : KindOfDef
+//purpose :
+//=======================================================================
+GEOMAlgo_KindOfDef GEOMAlgo_ShapeInfo::KindOfDef() const
+{
+ return myKindOfDef;
+}
+//=======================================================================
//function : SetLocation
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
{
myLocation=aP;
}
//function : Location
//purpose :
//=======================================================================
- const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
{
return myLocation;
}
//function : SetDirection
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
+void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
{
myDirection=aD;
}
//function : Direction
//purpose :
//=======================================================================
- const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
+const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
{
return myDirection;
}
//function : SetPosition
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
{
gp_Ax3 aAx3(aAx2);
SetPosition(aAx3);
//function : SetPosition
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
{
myPosition=aAx3;
}
//function : Position
//purpose :
//=======================================================================
- const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
+const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
{
return myPosition;
}
//function : SetPnt1
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
{
myPnt1=aP;
}
//function : Pnt1
//purpose :
//=======================================================================
- const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
{
return myPnt1;
}
//function : SetPnt2
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
{
myPnt2=aP;
}
//function : Pnt2
//purpose :
//=======================================================================
- const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
{
return myPnt2;
}
//function : SetRadius1
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
{
myRadius1=aR;
}
//function : Radius1
//purpose :
//=======================================================================
- Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
{
return myRadius1;
}
//function : SetRadius2
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
{
myRadius2=aR;
}
//function : Radius2
//purpose :
//=======================================================================
- Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
{
return myRadius2;
}
//function : SetLength
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
+void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
{
myLength=aL;
}
//function : Length
//purpose :
//=======================================================================
- Standard_Real GEOMAlgo_ShapeInfo::Length() const
+Standard_Real GEOMAlgo_ShapeInfo::Length() const
{
return myLength;
}
//function : SetWidth
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
+void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
{
myWidth=aW;
}
//function : Width
//purpose :
//=======================================================================
- Standard_Real GEOMAlgo_ShapeInfo::Width() const
+Standard_Real GEOMAlgo_ShapeInfo::Width() const
{
return myWidth;
}
//function : SetHeight
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
+void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
{
myHeight=aH;
}
//function : Height
//purpose :
//=======================================================================
- Standard_Real GEOMAlgo_ShapeInfo::Height() const
+Standard_Real GEOMAlgo_ShapeInfo::Height() const
{
return myHeight;
}
//function : Dump
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::Dump()const
+void GEOMAlgo_ShapeInfo::Dump()const
{
switch (myType) {
//
break;
//
default:
- printf(" * not implememted yet\n");
+ printf(" * not implemented yet\n");
break;
}
}
//function : DumpCompound
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpCompound()const
+void GEOMAlgo_ShapeInfo::DumpCompound()const
{
Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
GEOMAlgo_KindOfShape aKS;
//function : DumpCompSolid
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpCompSolid()const
+void GEOMAlgo_ShapeInfo::DumpCompSolid()const
{
Standard_Integer aNbV, aNbE, aNbF, aNbS;
GEOMAlgo_KindOfShape aKS;
DumpKindOfBounds(aKB);
DumpKindOfClosed(aKC);
}
-
//=======================================================================
//function : DumpSolid
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpSolid()const
+void GEOMAlgo_ShapeInfo::DumpSolid()const
{
Standard_Integer aNbV, aNbE, aNbF;
GEOMAlgo_KindOfShape aKS;
printf(" Height : %.3lf\n", myHeight);
}
}
-
//=======================================================================
//function : DumpFace
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpFace()const
+void GEOMAlgo_ShapeInfo::DumpFace()const
{
Standard_Integer aNbV, aNbE;
GEOMAlgo_KindOfShape aKS;
GEOMAlgo_KindOfName aKN;
GEOMAlgo_KindOfBounds aKB;
GEOMAlgo_KindOfClosed aKC;
+ GEOMAlgo_KindOfDef aKD;
//
aNbV=NbSubShapes(TopAbs_VERTEX);
aNbE=NbSubShapes(TopAbs_EDGE);
aKN=KindOfName();
aKB=KindOfBounds();
aKC=KindOfClosed();
+ aKD=KindOfDef();
//
printf(" *FACE\n");
printf(" number of vertices: %d\n", aNbV);
DumpKindOfName (aKN);
DumpKindOfBounds(aKB);
DumpKindOfClosed(aKC);
+ DumpKindOfDef(aKD);
//
// PLANE
if (aKN==GEOMAlgo_KN_PLANE) {
//function : DumpShell
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpShell()const
+void GEOMAlgo_ShapeInfo::DumpShell()const
{
Standard_Integer aNbV, aNbE, aNbF;
GEOMAlgo_KindOfClosed aKC;
//function : DumpWire
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpWire()const
+void GEOMAlgo_ShapeInfo::DumpWire()const
{
Standard_Integer aNbV, aNbE;
GEOMAlgo_KindOfClosed aKC;
//function : DumpEdge
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpEdge()const
+void GEOMAlgo_ShapeInfo::DumpEdge()const
{
Standard_Integer aNbV;
Standard_Real aX, aY, aZ;
//function : DumpVertex
//purpose :
//=======================================================================
- void GEOMAlgo_ShapeInfo::DumpVertex()const
+void GEOMAlgo_ShapeInfo::DumpVertex()const
{
printf(" *VERTEX\n");
DumpLocation(myLocation);
//function : DumpLocation
//purpose :
//=======================================================================
- void DumpLocation(const gp_Pnt& aP)
+void DumpLocation(const gp_Pnt& aP)
{
Standard_Real aX, aY, aZ;
//
//function : DumpDirection
//purpose :
//=======================================================================
- void DumpDirection(const gp_Dir& aD)
+void DumpDirection(const gp_Dir& aD)
{
Standard_Real aX, aY, aZ;
//
"KN_RECTANGLE",
"KN_TRIANGLE",
"KN_QUADRANGLE",
- "KN_ARCELLIPSE"
+ "KN_ARCELLIPSE",
+ "KN_SOLID"
};
int i;
//
i=(Standard_Integer)aKS;
printf(" KindOfName : %s\n", pStr[i]);
}
+//=======================================================================
+//function : DumpKindOfDef
+//purpose :
+//=======================================================================
+void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD)
+{
+ const char *pStr[]={
+ "KD_UNKNOWN",
+ "KD_SPECIFIED",
+ "KB_ARBITRARY"
+ };
+ int i;
+ //
+ i=(Standard_Integer)aKD;
+ printf(" KindOfDef: %s\n", pStr[i]);
+}