Back to index

salome-geom  6.5.0
Public Member Functions | Protected Attributes
GEOMAlgo_ClsfBox Class Reference

#include <GEOMAlgo_ClsfBox.hxx>

Inheritance diagram for GEOMAlgo_ClsfBox:
Inheritance graph
[legend]
Collaboration diagram for GEOMAlgo_ClsfBox:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_ClsfBox ()
virtual Standard_EXPORT ~GEOMAlgo_ClsfBox ()
Standard_EXPORT void SetBox (const TopoDS_Shape &aS)
Standard_EXPORT const
TopoDS_Shape & 
Box () const
virtual Standard_EXPORT void Perform ()
virtual Standard_EXPORT void CheckData ()
virtual Standard_EXPORT
Standard_Boolean 
CanBeON (const Handle(Geom_Curve)&aC) const
virtual Standard_EXPORT
Standard_Boolean 
CanBeON (const Handle(Geom_Surface)&aST) const
Standard_EXPORT void SetPnt (const gp_Pnt &aP)
Standard_EXPORT const gp_Pnt & Pnt () const
Standard_EXPORT void SetTolerance (const Standard_Real aT)
Standard_EXPORT Standard_Real Tolerance () const
Standard_EXPORT TopAbs_State State () const
 DEFINE_STANDARD_RTTI (GEOMAlgo_Clsf)
 DEFINE_STANDARD_RTTI (GEOMAlgo_HAlgo)
virtual Standard_EXPORT void CheckResult ()
Standard_EXPORT Standard_Integer ErrorStatus () const
Standard_EXPORT Standard_Integer WarningStatus () const

Protected Attributes

TopoDS_Shape myBox
GeomAdaptor_Surface myGAS [6]
TopAbs_State myState
gp_Pnt myPnt
Standard_Real myTolerance
Standard_Integer myErrorStatus
Standard_Integer myWarningStatus

Detailed Description

Definition at line 49 of file GEOMAlgo_ClsfBox.hxx.


Constructor & Destructor Documentation

Definition at line 53 of file GEOMAlgo_ClsfBox.cxx.

:
  GEOMAlgo_Clsf()
{
}

Definition at line 62 of file GEOMAlgo_ClsfBox.cxx.

{
}

Member Function Documentation

const TopoDS_Shape & GEOMAlgo_ClsfBox::Box ( ) const

Definition at line 77 of file GEOMAlgo_ClsfBox.cxx.

{
  return myBox;
}
Standard_Boolean GEOMAlgo_ClsfBox::CanBeON ( const Handle(Geom_Curve)&  aC) const [virtual]

Reimplemented from GEOMAlgo_Clsf.

Definition at line 203 of file GEOMAlgo_ClsfBox.cxx.

{
  return GEOMAlgo_Clsf::CanBeON(aC);
}
Standard_Boolean GEOMAlgo_ClsfBox::CanBeON ( const Handle(Geom_Surface)&  aST) const [virtual]

Reimplemented from GEOMAlgo_Clsf.

Definition at line 211 of file GEOMAlgo_ClsfBox.cxx.

{
  Standard_Boolean bRet;
  GeomAbs_SurfaceType  aST1;
  GeomAdaptor_Surface aGAS1;
  //
  aGAS1.Load(aS1);
  aST1=aGAS1.GetType();
  bRet=(aST1==GeomAbs_Plane);
  //
  return bRet;
}
void GEOMAlgo_ClsfBox::CheckData ( ) [virtual]

Reimplemented from GEOMAlgo_HAlgo.

Definition at line 85 of file GEOMAlgo_ClsfBox.cxx.

{
  Standard_Integer i, aNbF;
  TopAbs_ShapeEnum aTypeShape;
  TopAbs_Orientation aOr;
  GeomAbs_SurfaceType aType;
  Handle(Geom_Surface) aS;
  TopTools_IndexedMapOfShape aMF;
  //
  myErrorStatus=0;
  //
  if(myBox.IsNull()) {
    myErrorStatus=10; // myBox=NULL
    return;
  }
  //
  aTypeShape=myBox.ShapeType();
  if (aTypeShape!=TopAbs_SOLID) {
    myErrorStatus=11; // unallowed shape type
    return;
  }
  //
  TopExp::MapShapes(myBox, TopAbs_FACE, aMF);
  aNbF=aMF.Extent();
  if (aNbF!=6) {
    myErrorStatus=12; // wrong number of faces
    return;
  }
  //
  for (i=1; i<=aNbF; ++i) {
    const TopoDS_Face& aF=TopoDS::Face(aMF(i));
    aOr=aF.Orientation();
    if (!(aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED)) {
      myErrorStatus=12; // unallowed orientation of face
      return;
    }
    //
    aS=BRep_Tool::Surface(aF);
    myGAS[i-1].Load(aS);
    aType=myGAS[i-1].GetType();
    if (!aType==GeomAbs_Plane) {
      myErrorStatus=13; // unallowed surface type
      return;
    }
    //
    if(aOr==TopAbs_REVERSED) {
      gp_Ax1 aAx1;
      gp_Pln aPln;
      gp_Pnt aP;
      gp_Dir aD;
      Handle(Geom_Plane) aSR;
      //
      aPln=myGAS[i-1].Plane();
      aAx1=aPln.Axis();
      aP=aAx1.Location();
      aD=aAx1.Direction();
      aD.Reverse();
      aSR=new Geom_Plane(aP, aD);
      myGAS[i-1].Load(aSR);
    }
  }
}

Here is the call graph for this function:

void GEOMAlgo_HAlgo::CheckResult ( ) [virtual, inherited]

Definition at line 61 of file GEOMAlgo_HAlgo.cxx.

Standard_Integer GEOMAlgo_HAlgo::ErrorStatus ( ) const [inherited]

Definition at line 69 of file GEOMAlgo_HAlgo.cxx.

{
  return myErrorStatus;
}
void GEOMAlgo_ClsfBox::Perform ( ) [virtual]

Implements GEOMAlgo_HAlgo.

Definition at line 151 of file GEOMAlgo_ClsfBox.cxx.

{
  myErrorStatus=0;
  //
  const Standard_Integer aNbS=6;
  Standard_Integer i, aNbON, aNbIN, iNext;
  TopAbs_State aSt;
  /*
  CheckData();
  if(myErrorStatus) {
    return;
  }
  */
  iNext=1;
  aNbON=0;
  aNbIN=0;
  for(i=0; i<aNbS && iNext; i++) {
    GEOMAlgo_SurfaceTools::GetState(myPnt, myGAS[i], myTolerance, aSt);
    //
    switch (aSt) {
      case TopAbs_OUT:
        myState=aSt;
        iNext=0;
        break;
      case TopAbs_ON:
        ++aNbON;
        break;
      case TopAbs_IN:
        ++aNbIN;
        break;
      default:
        myState=TopAbs_UNKNOWN;
        iNext=0;
        break;
    }
  }
  //
  if (iNext) {
    myState=TopAbs_UNKNOWN;
    //
    if (aNbON && aNbIN) {
      myState=TopAbs_ON;
    }
    else if (aNbIN==aNbS){
      myState=TopAbs_IN;
    }
  }
}

Here is the call graph for this function:

const gp_Pnt & GEOMAlgo_Clsf::Pnt ( ) const [inherited]

Definition at line 80 of file GEOMAlgo_Clsf.cxx.

{
  return myPnt;
}
void GEOMAlgo_ClsfBox::SetBox ( const TopoDS_Shape &  aS)

Definition at line 69 of file GEOMAlgo_ClsfBox.cxx.

{
  myBox=aBox;
}

Here is the caller graph for this function:

void GEOMAlgo_Clsf::SetPnt ( const gp_Pnt &  aP) [inherited]

Definition at line 72 of file GEOMAlgo_Clsf.cxx.

{
  myPnt=aP;
}
void GEOMAlgo_Clsf::SetTolerance ( const Standard_Real  aT) [inherited]

Definition at line 56 of file GEOMAlgo_Clsf.cxx.

{
  myTolerance=aT;
}
TopAbs_State GEOMAlgo_Clsf::State ( ) const [inherited]

Definition at line 88 of file GEOMAlgo_Clsf.cxx.

{
  return myState;
}
Standard_Real GEOMAlgo_Clsf::Tolerance ( ) const [inherited]

Definition at line 64 of file GEOMAlgo_Clsf.cxx.

{
  return myTolerance;
}
Standard_Integer GEOMAlgo_HAlgo::WarningStatus ( ) const [inherited]

Definition at line 77 of file GEOMAlgo_HAlgo.cxx.

{
  return myWarningStatus;
}

Member Data Documentation

TopoDS_Shape GEOMAlgo_ClsfBox::myBox [protected]

Definition at line 79 of file GEOMAlgo_ClsfBox.hxx.

Standard_Integer GEOMAlgo_HAlgo::myErrorStatus [protected, inherited]

Definition at line 71 of file GEOMAlgo_HAlgo.hxx.

GeomAdaptor_Surface GEOMAlgo_ClsfBox::myGAS[6] [protected]

Definition at line 80 of file GEOMAlgo_ClsfBox.hxx.

gp_Pnt GEOMAlgo_Clsf::myPnt [protected, inherited]

Definition at line 84 of file GEOMAlgo_Clsf.hxx.

TopAbs_State GEOMAlgo_Clsf::myState [protected, inherited]

Definition at line 83 of file GEOMAlgo_Clsf.hxx.

Standard_Real GEOMAlgo_Clsf::myTolerance [protected, inherited]

Definition at line 85 of file GEOMAlgo_Clsf.hxx.

Standard_Integer GEOMAlgo_HAlgo::myWarningStatus [protected, inherited]

Definition at line 72 of file GEOMAlgo_HAlgo.hxx.


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