Back to index

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

#include <GEOMAlgo_WESScaler.hxx>

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

List of all members.

Public Member Functions

Standard_EXPORT GEOMAlgo_WESScaler ()
 Empty constructor

virtual Standard_EXPORT ~GEOMAlgo_WESScaler ()
Standard_EXPORT void SetScale (const Standard_Real aWES)
 Modifier

Standard_EXPORT Standard_Real Scale () const
 Selector

Standard_EXPORT void SetFace (const TopoDS_Face &aF)
Standard_EXPORT const TopoDS_Face & Face () const
Standard_EXPORT void SetEdges (const TopTools_ListOfShape &aLE)
Standard_EXPORT const
TopTools_ListOfShape & 
Edges () const
virtual Standard_EXPORT void Perform ()
 Performs the algorithm

Standard_EXPORT const TopoDS_Face & FaceScaled () const
Standard_EXPORT const
TopTools_ListOfShape & 
EdgesScaled () const
Standard_EXPORT const
TopoDS_Shape & 
Image (const TopoDS_Shape &aS) const
Standard_EXPORT const
TopoDS_Shape & 
Origin (const TopoDS_Shape &aS) const
Standard_EXPORT const
GEOMAlgo_DataMapOfOrientedShapeShape
Images () const
 Selector

Standard_EXPORT const
GEOMAlgo_DataMapOfOrientedShapeShape
Origins () const
 Selector

Standard_EXPORT Standard_Integer ErrorStatus () const
Standard_EXPORT Standard_Integer WarningStatus () const
Standard_EXPORT void ComputeInternalShapes (const Standard_Boolean theFlag)
 Allows to omit of creation of internal shapes (manifold topology).
Needed for the SALOME/TRIPOLI module.

Protected Member Functions

virtual Standard_EXPORT void CheckData ()
 Performs the algorithm

virtual Standard_EXPORT void CheckResult ()

Protected Attributes

Standard_Real myScale
TopoDS_Face myFace
TopTools_ListOfShape myEdges
TopoDS_Face myFaceScaled
TopTools_ListOfShape myEdgesScaled
GEOMAlgo_DataMapOfOrientedShapeShape myImages
GEOMAlgo_DataMapOfOrientedShapeShape myOrigins
TopoDS_Shape myShapeTmp
Standard_Integer myErrorStatus
Standard_Integer myWarningStatus
Standard_Boolean myComputeInternalShapes

Detailed Description

Definition at line 40 of file GEOMAlgo_WESScaler.hxx.


Constructor & Destructor Documentation

Empty constructor

Definition at line 45 of file GEOMAlgo_WESScaler.cxx.

:
  GEOMAlgo_Algo()
{
  myScale=1.;
}

Definition at line 55 of file GEOMAlgo_WESScaler.cxx.

{
}

Member Function Documentation

void GEOMAlgo_WESScaler::CheckData ( ) [protected, virtual]

Performs the algorithm

Reimplemented from GEOMAlgo_Algo.

Definition at line 164 of file GEOMAlgo_WESScaler.cxx.

{
  myErrorStatus=0;
  //
  if(myFace.IsNull()) {
    myErrorStatus=2;
    return;
  }
  if(!myEdges.Extent()) {
    myErrorStatus=3;
    return;
  }
  if (myScale<=0.){
    myErrorStatus=4;
  }
}

Here is the caller graph for this function:

void GEOMAlgo_Algo::CheckResult ( ) [protected, virtual, inherited]

Reimplemented in GEOMAlgo_Gluer.

Definition at line 59 of file GEOMAlgo_Algo.cxx.

void GEOMAlgo_Algo::ComputeInternalShapes ( const Standard_Boolean  theFlag) [inherited]

Allows to omit of creation of internal shapes (manifold topology).
Needed for the SALOME/TRIPOLI module.

Definition at line 87 of file GEOMAlgo_Algo.cxx.

{
  myComputeInternalShapes = theFlag;
}

Here is the caller graph for this function:

const TopTools_ListOfShape & GEOMAlgo_WESScaler::Edges ( ) const

Definition at line 102 of file GEOMAlgo_WESScaler.cxx.

{
  return myEdges;
}
const TopTools_ListOfShape & GEOMAlgo_WESScaler::EdgesScaled ( ) const

Definition at line 118 of file GEOMAlgo_WESScaler.cxx.

{
  return myEdgesScaled;
}

Here is the caller graph for this function:

Standard_Integer GEOMAlgo_Algo::ErrorStatus ( ) const [inherited]

Definition at line 67 of file GEOMAlgo_Algo.cxx.

{
  return myErrorStatus;
}

Here is the caller graph for this function:

const TopoDS_Face & GEOMAlgo_WESScaler::Face ( ) const

Definition at line 86 of file GEOMAlgo_WESScaler.cxx.

{
  return myFace;
}
const TopoDS_Face & GEOMAlgo_WESScaler::FaceScaled ( ) const

Definition at line 110 of file GEOMAlgo_WESScaler.cxx.

{
  return myFaceScaled;
}

Here is the caller graph for this function:

const TopoDS_Shape & GEOMAlgo_WESScaler::Image ( const TopoDS_Shape &  aS) const

Definition at line 126 of file GEOMAlgo_WESScaler.cxx.

{
  if (myImages.IsBound(aS)) {
    return myImages.Find(aS);
  }
  return myShapeTmp;
}

Selector

Definition at line 148 of file GEOMAlgo_WESScaler.cxx.

{
  return myImages;
}
const TopoDS_Shape & GEOMAlgo_WESScaler::Origin ( const TopoDS_Shape &  aS) const

Definition at line 137 of file GEOMAlgo_WESScaler.cxx.

{
  if (myOrigins.IsBound(aS)) {
    return myOrigins.Find(aS);
  }
  return myShapeTmp;
}

Here is the caller graph for this function:

Selector

Definition at line 156 of file GEOMAlgo_WESScaler.cxx.

{
  return myOrigins;
}
void GEOMAlgo_WESScaler::Perform ( ) [virtual]

Performs the algorithm

Implements GEOMAlgo_Algo.

Definition at line 184 of file GEOMAlgo_WESScaler.cxx.

{
  Standard_Boolean bIsDone;
  Standard_Integer i;
  gp_Pnt aP;
  gp_Trsf aTrsf;
  TopAbs_Orientation aOr;
  TopoDS_Shape aFC, aFR, aER;
  TopoDS_Wire aWE;
  TopoDS_Iterator aItS;
  BRep_Builder aBB;
  TopTools_ListIteratorOfListOfShape aIt;
  //
  // 0. CheckData
  CheckData();
  if(myErrorStatus) {
    return;
  }
  //
  myImages.Clear();
  myOrigins.Clear();
  myEdgesScaled.Clear();
  //
  // 1. aFC
  aFC=myFace.EmptyCopied();
  //
  aBB.MakeWire(aWE);
  aIt.Initialize(myEdges);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aE=aIt.Value();
    aBB.Add(aWE, aE);
  }
  aBB.Add(aFC, aWE);
  //
  aItS.Initialize(myFace);
  for (; aItS.More(); aItS.Next()) {
    const TopoDS_Shape& aW=aItS.Value();
    aBB.Add(aFC, aW);
  }
  //
  // 2. Scale aFC
  aP.SetCoord(0.,0.,0.);
  aTrsf.SetScale(aP, myScale);
  //
  BRepBuilderAPI_Transform aBT(aTrsf);
  aBT.Perform(aFC);
  bIsDone=aBT.IsDone();
  if (!bIsDone) {
    myErrorStatus=10;
    return;
  }
  //
  const TopoDS_Shape& aSR=aBT.Shape();
  //
  // Refined image face FR
  aFR=aSR.EmptyCopied();
  aItS.Initialize(aSR);
  for (i=0; aItS.More(); aItS.Next(),++i) {
    const TopoDS_Shape& aWR=aItS.Value();
    if (i) {
      aBB.Add(aFR, aWR);
    }
  }
  myFaceScaled=*((TopoDS_Face*)&aFR);
  //
  // 3. Fill Images, Origins, EdgesScaled
  aIt.Initialize(myEdges);
  for (; aIt.More(); aIt.Next()) {
    const TopoDS_Shape& aE=aIt.Value();
    aOr=aE.Orientation();
    //
    aER=aBT.ModifiedShape(aE);
    if(aER.IsNull()) {
      myErrorStatus=11;
      return;
    }
    //
    aER.Orientation(aOr);
    myImages.Bind(aE, aER);
    myOrigins.Bind(aER, aE);
    //
    myEdgesScaled.Append(aER);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Real GEOMAlgo_WESScaler::Scale ( ) const

Selector

Definition at line 70 of file GEOMAlgo_WESScaler.cxx.

{
  return myScale;
}
void GEOMAlgo_WESScaler::SetEdges ( const TopTools_ListOfShape &  aLE)

Definition at line 94 of file GEOMAlgo_WESScaler.cxx.

{
  myEdges=aLE;
}

Here is the caller graph for this function:

void GEOMAlgo_WESScaler::SetFace ( const TopoDS_Face &  aF)

Definition at line 78 of file GEOMAlgo_WESScaler.cxx.

{
  myFace=aF;
}

Here is the caller graph for this function:

void GEOMAlgo_WESScaler::SetScale ( const Standard_Real  aWES)

Modifier

Definition at line 62 of file GEOMAlgo_WESScaler.cxx.

{
  myScale=aScale;
}

Here is the caller graph for this function:

Standard_Integer GEOMAlgo_Algo::WarningStatus ( ) const [inherited]

Definition at line 75 of file GEOMAlgo_Algo.cxx.

{
  return myWarningStatus;
}

Here is the caller graph for this function:


Member Data Documentation

Standard_Boolean GEOMAlgo_Algo::myComputeInternalShapes [protected, inherited]

Definition at line 73 of file GEOMAlgo_Algo.hxx.

TopTools_ListOfShape GEOMAlgo_WESScaler::myEdges [protected]

Definition at line 102 of file GEOMAlgo_WESScaler.hxx.

TopTools_ListOfShape GEOMAlgo_WESScaler::myEdgesScaled [protected]

Definition at line 104 of file GEOMAlgo_WESScaler.hxx.

Standard_Integer GEOMAlgo_Algo::myErrorStatus [protected, inherited]

Definition at line 71 of file GEOMAlgo_Algo.hxx.

TopoDS_Face GEOMAlgo_WESScaler::myFace [protected]

Definition at line 101 of file GEOMAlgo_WESScaler.hxx.

TopoDS_Face GEOMAlgo_WESScaler::myFaceScaled [protected]

Definition at line 103 of file GEOMAlgo_WESScaler.hxx.

Definition at line 105 of file GEOMAlgo_WESScaler.hxx.

Definition at line 106 of file GEOMAlgo_WESScaler.hxx.

Standard_Real GEOMAlgo_WESScaler::myScale [protected]

Definition at line 100 of file GEOMAlgo_WESScaler.hxx.

TopoDS_Shape GEOMAlgo_WESScaler::myShapeTmp [protected]

Definition at line 107 of file GEOMAlgo_WESScaler.hxx.

Standard_Integer GEOMAlgo_Algo::myWarningStatus [protected, inherited]

Definition at line 72 of file GEOMAlgo_Algo.hxx.


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