1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0022312: Translation of french commentaries in OCCT files

This commit is contained in:
YSN 2011-10-27 07:50:55 +00:00 committed by bugmaster
parent b2342827fa
commit 0d9695538c
214 changed files with 8746 additions and 10449 deletions

View File

@ -461,11 +461,11 @@ Standard_Boolean AIS::ComputeGeometry(const TopoDS_Edge& anEdge1,
if (isOnPlanC1 && isOnPlanC2) return Standard_True; if (isOnPlanC1 && isOnPlanC2) return Standard_True;
if (!isOnPlanC1 && isOnPlanC2) {// courbe 2 seulement dans le plan if (!isOnPlanC1 && isOnPlanC2) {// curve 2 only in the plane
indexExt = 1; indexExt = 1;
extCurve = aSov1; extCurve = aSov1;
} }
else if (isOnPlanC1 && !isOnPlanC2) {// courbe 1 seulement dans le plan else if (isOnPlanC1 && !isOnPlanC2) {// curve 1 only in the plane
indexExt = 2; indexExt = 2;
extCurve = aSov2; extCurve = aSov2;
} }
@ -742,7 +742,7 @@ void AIS::ComputeLengthBetweenPlanarFaces( const TopoDS_Face & FirstFace,
gp_Pnt & Position ) gp_Pnt & Position )
{ {
TopExp_Explorer aExp( FirstFace, TopAbs_VERTEX ); TopExp_Explorer aExp( FirstFace, TopAbs_VERTEX );
// cas des plans infinis . SMO. // case of infinite planes. SMO.
if (!aExp.More()) if (!aExp.More())
FirstAttach = Plane1.Location(); FirstAttach = Plane1.Location();
else else
@ -808,7 +808,7 @@ static gp_Pnt FindFarPoint (const gp_Ax1 & anAxis,
TopExp_Explorer Explo (aFace, TopAbs_VERTEX); TopExp_Explorer Explo (aFace, TopAbs_VERTEX);
if (!Explo.More()) { if (!Explo.More()) {
// Cas des plans infinis (pas de Vertex, pas d'arete) // Case of infinite planes (no Vertex, no edge)
gp_Pln plane; gp_Pln plane;
Handle( Geom_Surface ) aSurf; Handle( Geom_Surface ) aSurf;
AIS_KindOfSurface KOS; AIS_KindOfSurface KOS;
@ -1370,7 +1370,7 @@ void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPres
TopoDS_Edge E; TopoDS_Edge E;
// Calcul de la presentation de l'edge // Calculate presentation of the edge
if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) { if (ProjCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) {
// CLE // CLE
// const Handle(Geom_Line) & gl = (Handle(Geom_Line)&) ProjCurve; // const Handle(Geom_Line) & gl = (Handle(Geom_Line)&) ProjCurve;
@ -1399,7 +1399,7 @@ void AIS::ComputeProjEdgePresentation( const Handle( Prs3d_Presentation )& aPres
} }
StdPrs_WFDeflectionShape::Add(aPresentation, E, aDrawer); StdPrs_WFDeflectionShape::Add(aPresentation, E, aDrawer);
//Calcul de la presentation des lignes de raccord //Calculate the presentation of line connections
aDrawer->WireAspect()->SetTypeOfLine(aCallTOL); aDrawer->WireAspect()->SetTypeOfLine(aCallTOL);
if (!isInfinite) { if (!isInfinite) {
gp_Pnt ppf(0.0,0.0,0.0), ppl(0.0,0.0,0.0); gp_Pnt ppf(0.0,0.0,0.0), ppl(0.0,0.0,0.0);
@ -1461,7 +1461,7 @@ void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPr
pa->SetTypeOfMarker(aProjTOM); pa->SetTypeOfMarker(aProjTOM);
} }
// calcul du projete // calculate the projection
StdPrs_Point::Add(aPresentation, new Geom_CartesianPoint(ProjPoint), aDrawer); StdPrs_Point::Add(aPresentation, new Geom_CartesianPoint(ProjPoint), aDrawer);
if (!aDrawer->HasWireAspect()){ if (!aDrawer->HasWireAspect()){
@ -1476,9 +1476,9 @@ void AIS::ComputeProjVertexPresentation( const Handle( Prs3d_Presentation )& aPr
li->SetWidth(aWidth); li->SetWidth(aWidth);
} }
// Si les points ne sont pas confondus... // If the points are not mixed...
if (!ProjPoint.IsEqual (BRep_Tool::Pnt(aVertex),Precision::Confusion())) { if (!ProjPoint.IsEqual (BRep_Tool::Pnt(aVertex),Precision::Confusion())) {
// calcul des lignes de rappel // calculate the lines of recall
BRepBuilderAPI_MakeEdge MakEd(ProjPoint,BRep_Tool::Pnt(aVertex)); BRepBuilderAPI_MakeEdge MakEd(ProjPoint,BRep_Tool::Pnt(aVertex));
StdPrs_WFDeflectionShape::Add(aPresentation, MakEd.Edge(), aDrawer); StdPrs_WFDeflectionShape::Add(aPresentation, MakEd.Edge(), aDrawer);
} }

View File

@ -70,7 +70,7 @@
// is always equal to 0 if it is -1. // is always equal to 0 if it is -1.
#define BUC61051 #define BUC61051
// On close the local context the method ::ResetOriginalState() sets the selection mode equal to 0 // The local context is closed the method ::ResetOriginalState() sets the selection mode equal to 0
// in spite of the selection mode of the interactive object in Natural Point. // in spite of the selection mode of the interactive object in Natural Point.
#define OCC166 #define OCC166
@ -226,7 +226,7 @@ void AIS_InteractiveContext::UpdateCurrentViewer()
void AIS_InteractiveContext::OpenCollector() void AIS_InteractiveContext::OpenCollector()
{ {
myIsCollClosed =Standard_True; myIsCollClosed =Standard_True;
// a completer.... // to be completed....
} }
@ -263,7 +263,7 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
} }
else{ else{
TColStd_MapOfTransient theMap; TColStd_MapOfTransient theMap;
// point neutre // neutral point
for(;It.More();It.Next()){ for(;It.More();It.Next()){
if(It.Value()->GraphicStatus()==AIS_DS_Displayed) if(It.Value()->GraphicStatus()==AIS_DS_Displayed)
theMap.Add(It.Key()); theMap.Add(It.Key());
@ -272,7 +272,7 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
cout<<"\tFrom Neutral Point : "<<theMap.Extent()<<endl; cout<<"\tFrom Neutral Point : "<<theMap.Extent()<<endl;
#endif #endif
//balayons tous les contextes locaux... //parse all local contexts...
Standard_Integer NbDisp; Standard_Integer NbDisp;
for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){ for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){
const Handle(AIS_LocalContext)& LC = it1.Value(); const Handle(AIS_LocalContext)& LC = it1.Value();
@ -457,7 +457,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
if(!anIObj->HasInteractiveContext()) if(!anIObj->HasInteractiveContext())
anIObj->SetContext(aThis); anIObj->SetContext(aThis);
//PAS DE CONTEXTE LOCAL OUVERT //NO LOCAL CONTEXT OPEN
if(!HasOpenedContext()) { if(!HasOpenedContext()) {
#ifndef OCC4373 #ifndef OCC4373
// SAN : Do not return here. Perform advanced display mode analysis a bit later... // SAN : Do not return here. Perform advanced display mode analysis a bit later...
@ -465,7 +465,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
#endif #endif
Standard_Boolean updcol = Standard_False; Standard_Boolean updcol = Standard_False;
// il n'existait pas encore // it did not yet exist
if(!myObjects.IsBound(anIObj)){ if(!myObjects.IsBound(anIObj)){
Handle(AIS_GlobalStatus) STATUS= Handle(AIS_GlobalStatus) STATUS=
@ -485,7 +485,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
if(updateviewer) myMainVwr->Update(); if(updateviewer) myMainVwr->Update();
} }
// il est quelque part ailleurs.... // it is somewhere else...
else { else {
// CLE // CLE
// const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj); // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
@ -498,7 +498,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
myCollectorPM->Erase(anIObj,HiMod); myCollectorPM->Erase(anIObj,HiMod);
mgrSelector->Deactivate(anIObj,myCollectorSel); mgrSelector->Deactivate(anIObj,myCollectorSel);
updcol = updateviewer; updcol = updateviewer;
}// attention on fait expres de ne pas mettre de break.. }// attention the break is not set on purpose...
case AIS_DS_FullErased:{ case AIS_DS_FullErased:{
TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes()); TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
for (;ItL.More();ItL.Next()){ for (;ItL.More();ItL.Next()){
@ -565,7 +565,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
if(updcol && !myCollectorVwr.IsNull()) myCollectorVwr->Update(); if(updcol && !myCollectorVwr.IsNull()) myCollectorVwr->Update();
} }
// CONTEXTE LOCAL OUVERT // LOCAL CONTEXT OPEN
else else
{ {
myLocalContexts(myCurLocalIndex)->Display(anIObj,DispMode,anIObj->AcceptShapeDecomposition(),SelMode); myLocalContexts(myCurLocalIndex)->Display(anIObj,DispMode,anIObj->AcceptShapeDecomposition(),SelMode);
@ -593,7 +593,7 @@ void AIS_InteractiveContext::Display(const Handle(AIS_InteractiveObject)& anIObj
if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this); if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
// si aucun contexte local... // if no local context...
if(!HasOpenedContext()) { if(!HasOpenedContext()) {
// if(!anIObj->HasDisplayMode()) // if(!anIObj->HasDisplayMode())
// anIObj->SetDisplayMode(aDisplayMode); // anIObj->SetDisplayMode(aDisplayMode);
@ -685,9 +685,8 @@ void AIS_InteractiveContext::Erase(const Handle(AIS_InteractiveObject)& anIObj,
} }
else else
{ {
// d'abors on regarde si on peut effacer dans le contexte local courant // First it is checked if it is possible to remove in the current local context
// ensuite, on essaye d'effacer dans les autres contextes locaux, // then one tries to remove in other local contexts, if they allow it...
// s'ils le permettent...
Standard_Boolean WasInCtx = myLocalContexts(myCurLocalIndex)->Erase(anIObj); Standard_Boolean WasInCtx = myLocalContexts(myCurLocalIndex)->Erase(anIObj);
// if(!WasInCtx) { // if(!WasInCtx) {
@ -1488,7 +1487,7 @@ void AIS_InteractiveContext::RecomputeSelectionOnly(const Handle(AIS_Interactive
mgrSelector->RecomputeSelection(anIObj); mgrSelector->RecomputeSelection(anIObj);
// A VOIR SI ENCORE UTILE...
TColStd_ListOfInteger LI; TColStd_ListOfInteger LI;
TColStd_ListIteratorOfListOfInteger Lit; TColStd_ListIteratorOfListOfInteger Lit;
ActivatedModes(anIObj,LI); ActivatedModes(anIObj,LI);
@ -1576,7 +1575,7 @@ void AIS_InteractiveContext::SetLocation(const Handle(AIS_InteractiveObject)& an
} }
if(aLoc.IsIdentity()) return ; if(aLoc.IsIdentity()) return ;
// d'abord faire un reset de la precedente location pour tout nettoyer proprement... // first reset the previous location to properly clean everything...
if(anIObj->HasLocation()) if(anIObj->HasLocation())
anIObj->ResetLocation(); anIObj->ResetLocation();
@ -1950,7 +1949,7 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
@ -2025,7 +2024,7 @@ void AIS_InteractiveContext::SetDeviationCoefficient(
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
if(updateviewer) UpdateCurrentViewer(); if(updateviewer) UpdateCurrentViewer();
@ -2069,7 +2068,7 @@ void AIS_InteractiveContext::SetHLRDeviationCoefficient(
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
if(updateviewer) UpdateCurrentViewer(); if(updateviewer) UpdateCurrentViewer();
@ -2112,7 +2111,7 @@ void AIS_InteractiveContext::SetDeviationAngle(
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
if(updateviewer) UpdateCurrentViewer(); if(updateviewer) UpdateCurrentViewer();
@ -2183,7 +2182,7 @@ void AIS_InteractiveContext::SetHLRAngleAndDeviation(
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
if(updateviewer) UpdateCurrentViewer(); if(updateviewer) UpdateCurrentViewer();
@ -2225,7 +2224,7 @@ void AIS_InteractiveContext::SetHLRDeviationAngle(
} }
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
} }
if(updateviewer) UpdateCurrentViewer(); if(updateviewer) UpdateCurrentViewer();
@ -2253,7 +2252,7 @@ void AIS_InteractiveContext::UnsetColor(const Handle(AIS_InteractiveObject)& anI
NbDisp++; NbDisp++;
} }
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
} }
@ -2326,7 +2325,7 @@ void AIS_InteractiveContext::SetWidth(const Handle(AIS_InteractiveObject)& anIOb
NbDisp++; NbDisp++;
} }
#ifdef DEB #ifdef DEB
cout<<"nb de modes a recalculer : "<<NbDisp<<endl; cout<<"nb of modes to recalculate : "<<NbDisp<<endl;
#endif #endif
anIObj->SetRecomputeOk(); anIObj->SetRecomputeOk();
} }

View File

@ -868,14 +868,13 @@ void AIS_LengthDimension::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Pre
Position, Position,
SymbolPrs); SymbolPrs);
//Display des morceaux de raccordement vers la curve si elle //Display the pieces connecting to the curve if it is not in the WP
// n'est pas dans le WP
if (ExtShape != 0) { if (ExtShape != 0) {
if (!extCurv.IsNull()) { // c'est l'edge qui n'est pas dans le WP if (!extCurv.IsNull()) { // this is the edge that is not in the WP
AIS::ComputeProjEdgePresentation(aPresentation,aDrawer,theedge,geom_lin,ptonedge1,ptonedge2); AIS::ComputeProjEdgePresentation(aPresentation,aDrawer,theedge,geom_lin,ptonedge1,ptonedge2);
} }
else { // c'est le point qui n'est pas dans le WP else { // this is the point that is not in the WP
AIS::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach); AIS::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach);
} }
} }

View File

@ -297,7 +297,7 @@ void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation
} }
else return; else return;
//On cherche d'abord le vertex de tangence s'il existe //First find the tangengy vector if exists
TopoDS_Vertex VCom; TopoDS_Vertex VCom;
TopExp_Explorer expF(TopoDS::Edge(myFShape),TopAbs_VERTEX); TopExp_Explorer expF(TopoDS::Edge(myFShape),TopAbs_VERTEX);
TopExp_Explorer expS(TopoDS::Edge(mySShape),TopAbs_VERTEX); TopExp_Explorer expS(TopoDS::Edge(mySShape),TopAbs_VERTEX);

View File

@ -399,7 +399,7 @@ void AIS_TexturedShape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
TopLoc_Location aLocation = myFace.Location(); TopLoc_Location aLocation = myFace.Location();
#ifdef DEBUG #ifdef DEBUG
cout << "J\'explore actuellement la face " << NumFace << "\n" << endl; cout << "The face is being processed" << NumFace << "\n" << endl;
#endif #endif
Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, aLocation); Handle(Poly_Triangulation) myT = BRep_Tool::Triangulation(myFace, aLocation);
// Returns the Triangulation of the face. It is a null handle if there is no triangulation. // Returns the Triangulation of the face. It is a null handle if there is no triangulation.
@ -429,7 +429,7 @@ void AIS_TexturedShape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
for (nt = 1; nt <= nnn; nt++) for (nt = 1; nt <= nnn; nt++)
{ {
#ifdef DEBUG #ifdef DEBUG
cout << "On traite actuellement le triangle : "<< nt <<"\n"; cout << "The triangle is being processed: "<< nt <<"\n";
#endif #endif
if (SST.Orientation(myFace) == TopAbs_REVERSED) // if the face is "reversed" if (SST.Orientation(myFace) == TopAbs_REVERSED) // if the face is "reversed"
triangles(nt).Get(n1,n3,n2); // the triangle is n1,n3,n2 triangles(nt).Get(n1,n3,n2); // the triangle is n1,n3,n2
@ -437,7 +437,7 @@ void AIS_TexturedShape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
triangles(nt).Get(n1,n2,n3); // the triangle is n1,n2,n3 triangles(nt).Get(n1,n2,n3); // the triangle is n1,n2,n3
if (TriangleIsValid (Nodes(n1),Nodes(n2),Nodes(n3)) ) if (TriangleIsValid (Nodes(n1),Nodes(n2),Nodes(n3)) )
{ // Associates vertexNT to each node { // vertexNT associated to each node
Graphic3d_Array1OfVertexNT Points(1,3); Graphic3d_Array1OfVertexNT Points(1,3);
Aspect_Array1OfEdge aretes(1,3); Aspect_Array1OfEdge aretes(1,3);

View File

@ -22,7 +22,7 @@
#include <Interface_Version.hxx> #include <Interface_Version.hxx>
#include <Interface_Macros.hxx> #include <Interface_Macros.hxx>
// IL S AGIT ICI DU HEADER GENERIQUE pour tout schema STEP ... // This is a generic header for any STEP sheme
static Handle(TCollection_HAsciiString) nulstr; static Handle(TCollection_HAsciiString) nulstr;
@ -71,7 +71,7 @@ void APIHeaderSection_MakeHeader::Init (const Standard_CString nameval)
if (fn.IsNull()) fn = new HeaderSection_FileName; if (fn.IsNull()) fn = new HeaderSection_FileName;
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(nameval); Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(nameval);
fn->SetName(name); fn->SetName(name);
Interface_MSG::TDate (timestamp,0,0,0,0,0,1,"C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // maintenant Interface_MSG::TDate (timestamp,0,0,0,0,0,1,"C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // actually
Handle(TCollection_HAsciiString) tst = Handle(TCollection_HAsciiString) tst =
new TCollection_HAsciiString(timestamp); new TCollection_HAsciiString(timestamp);
fn->SetTimeStamp(tst); fn->SetTimeStamp(tst);
@ -142,7 +142,7 @@ void APIHeaderSection_MakeHeader::Apply
header.AddItem(fn); header.AddItem(fn);
if (HasFs() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) { if (HasFs() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) {
// Schema defini ? Sinon le prendre depuis le protocole // Schema defined? If not take it from the protocole
Handle(TCollection_HAsciiString) sch; Handle(TCollection_HAsciiString) sch;
Handle(Interface_HArray1OfHAsciiString) schid = fs->SchemaIdentifiers(); Handle(Interface_HArray1OfHAsciiString) schid = fs->SchemaIdentifiers();
if (!schid.IsNull()) sch = schid->Value(1); if (!schid.IsNull()) sch = schid->Value(1);
@ -150,7 +150,7 @@ void APIHeaderSection_MakeHeader::Apply
schid = new Interface_HArray1OfHAsciiString(1,1); schid = new Interface_HArray1OfHAsciiString(1,1);
fs->SetSchemaIdentifiers(schid); fs->SetSchemaIdentifiers(schid);
} }
if (!sch.IsNull()) { if (sch->Length() < 2) sch.Nullify(); } // non defini if (!sch.IsNull()) { if (sch->Length() < 2) sch.Nullify(); } // not defined
if (sch.IsNull()) { if (sch.IsNull()) {
Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast
( model->Protocol()); ( model->Protocol());

View File

@ -24,7 +24,7 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real&
U = 0.0; U = 0.0;
} }
else if ( -Radius > Ploc.Z()* Tan(SAngle) ) { else if ( -Radius > Ploc.Z()* Tan(SAngle) ) {
// le point est du `mauvais` cote de l`apex // the point is at the `wrong` side of the apex
U = atan2(-Ploc.Y(), -Ploc.X()); U = atan2(-Ploc.Y(), -Ploc.X());
} }
else { else {
@ -60,7 +60,7 @@ void Adaptor3d_TopolTool::Initialize (const Handle(Adaptor3d_HSurface)& S)
//Adaptor2d_Line2d * Line2dPtr ; //Adaptor2d_Line2d * Line2dPtr ;
myNbSamplesU=-1; myNbSamplesU=-1;
Uinf = S->FirstUParameter(); // ou UIntervalFirst ?? Uinf = S->FirstUParameter(); // where UIntervalFirst ??
Vinf = S->FirstVParameter(); Vinf = S->FirstVParameter();
Usup = S->LastUParameter(); Usup = S->LastUParameter();
Vsup = S->LastVParameter(); Vsup = S->LastVParameter();
@ -580,7 +580,7 @@ static void Analyse(const TColgp_Array2OfPnt& array2,
C.Y()-B.Y()-B.Y()+A.Y(), C.Y()-B.Y()-B.Y()+A.Y(),
C.Z()-B.Z()-B.Z()+A.Z()); C.Z()-B.Z()-B.Z()+A.Z());
Standard_Integer locnbch=0; Standard_Integer locnbch=0;
for(j=3; j<nbvp;j++) { //-- essai for(j=3; j<nbvp;j++) { //-- try
const gp_Pnt& A1=array2.Value(i,j-1); const gp_Pnt& A1=array2.Value(i,j-1);
const gp_Pnt& B1=array2.Value(i,j); const gp_Pnt& B1=array2.Value(i,j);
const gp_Pnt& C1=array2.Value(i,j+1); const gp_Pnt& C1=array2.Value(i,j+1);
@ -611,7 +611,7 @@ static void Analyse(const TColgp_Array2OfPnt& array2,
C.Y()-B.Y()-B.Y()+A.Y(), C.Y()-B.Y()-B.Y()+A.Y(),
C.Z()-B.Z()-B.Z()+A.Z()); C.Z()-B.Z()-B.Z()+A.Z());
Standard_Integer locnbch=0; Standard_Integer locnbch=0;
for(i=3; i<nbup;i++) { //-- essai for(i=3; i<nbup;i++) { //-- try
const gp_Pnt& A1=array2.Value(i-1,j); const gp_Pnt& A1=array2.Value(i-1,j);
const gp_Pnt& B1=array2.Value(i,j); const gp_Pnt& B1=array2.Value(i,j);
const gp_Pnt& C1=array2.Value(i+1,j); const gp_Pnt& C1=array2.Value(i+1,j);
@ -665,7 +665,7 @@ void Adaptor3d_TopolTool::ComputeSamplePoints() {
default: { nbsu = 10; nbsv=10; } break; default: { nbsu = 10; nbsv=10; } break;
} }
//-- Si le nb de points est trop grand on analyse //-- If the number of points is too great... analyze
//-- //--
//-- //--
@ -863,7 +863,7 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl,
// break; // break;
// case GeomAbs_BSplineSurface: { // case GeomAbs_BSplineSurface: {
if(typS == GeomAbs_BSplineSurface) { if(typS == GeomAbs_BSplineSurface) {
// Treatment BSpline surface // Processing BSpline surface
BSplSamplePnts(theDefl, theNUmin, theNVmin); BSplSamplePnts(theDefl, theNUmin, theNVmin);
return; return;
} }

View File

@ -2,18 +2,6 @@
// Created: Wed Jul 3 15:34:08 1996 // Created: Wed Jul 3 15:34:08 1996
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi38> // <jct@sgi38>
// Modified: Wed Jan 15 10:04:41 1997
// by: Joelle CHAUVET
// G1135 : Constructor with criterion
// Private methods 'Init','InitGrid','Perform','ConvertBS',
// 'ComputePatches','ComputeConstraints',
// 'Compute3DErrors','ComputeCritError'
// Public method 'CritError'
// Fields 'myConditions','myResults','myConstraints'
// Modified: Fri Oct 3 14:58:05 1997
// by: Joelle CHAUVET
// GeomConvert_CompBezierSurfacesToBSplineSurface est remplace par
// Convert_GridPolynomialToPoles dans ConvertBS
#include <AdvApp2Var_ApproxAFunc2Var.hxx> #include <AdvApp2Var_ApproxAFunc2Var.hxx>
#include <AdvApp2Var_EvaluatorFunc2Var.hxx> #include <AdvApp2Var_EvaluatorFunc2Var.hxx>
@ -291,7 +279,7 @@ void AdvApp2Var_ApproxAFunc2Var::InitGrid(const Standard_Integer NbInt)
AdvApp2Var_Framework Constraints(Bag,UStrip,VStrip); AdvApp2Var_Framework Constraints(Bag,UStrip,VStrip);
// decoupes regulieres si NbInt>1 // regular cutting if NbInt>1
Standard_Real deltu = (myLastParInU-myFirstParInU)/NbInt, Standard_Real deltu = (myLastParInU-myFirstParInU)/NbInt,
deltv = (myLastParInV-myFirstParInV)/NbInt; deltv = (myLastParInV-myFirstParInV)/NbInt;
for (iint=1;iint<=NbInt-1;iint++) { for (iint=1;iint<=NbInt-1;iint++) {
@ -350,10 +338,10 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
while (myResult.FirstNotApprox(FirstNA)) { while (myResult.FirstNotApprox(FirstNA)) {
// completude de l'ensemble des contraintes // complete the set of constraints
ComputeConstraints(UChoice, VChoice, Func); ComputeConstraints(UChoice, VChoice, Func);
// discretisation des contraintes relatives au carreau // discretization of constraints relative to the square
myResult(FirstNA).Discretise(myConditions,myConstraints,Func); myResult(FirstNA).Discretise(myConditions,myConstraints,Func);
if ( ! myResult(FirstNA).IsDiscretised() ) { if ( ! myResult(FirstNA).IsDiscretised() ) {
myHasResult = myDone = Standard_False; myHasResult = myDone = Standard_False;
@ -361,8 +349,8 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error"); ("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
} }
// calcul du nombre et du type de decoupes autorisees // calculate the number and the type of autorized cuts
// en fonction du nombre de carreaux max et de la validite des decoupes suiv. // depending on the max number of squares and the validity of next cuts.
NbU = myResult.NbPatchInU(); NbU = myResult.NbPatchInU();
NbV = myResult.NbPatchInV(); NbV = myResult.NbPatchInV();
NbPatch = NbU*NbV; NbPatch = NbU*NbV;
@ -385,13 +373,13 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
if ( Umore && Vmore ) NumDec=5; if ( Umore && Vmore ) NumDec=5;
} }
// approximation du carreau // approximation of the square
myResult(FirstNA).MakeApprox(myConditions,myConstraints,NumDec); myResult(FirstNA).MakeApprox(myConditions,myConstraints,NumDec);
if ( ! myResult(FirstNA).IsApproximated() ) { if ( ! myResult(FirstNA).IsApproximated() ) {
switch (myResult(FirstNA).CutSense()) { switch (myResult(FirstNA).CutSense()) {
case 0 : case 0 :
// On ne peut plus decouper : on garde le resultat // It is not possible to cut : the result is preserved
if ( myResult(FirstNA).HasResult()) { if ( myResult(FirstNA).HasResult()) {
myResult(FirstNA).OverwriteApprox(); myResult(FirstNA).OverwriteApprox();
} }
@ -402,17 +390,17 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
} }
break; break;
case 1 : case 1 :
// Il faut decouper en U // It is necessary to cut in U
myResult.UpdateInU(Udec); myResult.UpdateInU(Udec);
myConstraints.UpdateInU(Udec); myConstraints.UpdateInU(Udec);
break; break;
case 2 : case 2 :
// Il faut decouper en V // It is necessary to cut in V
myResult.UpdateInV(Vdec); myResult.UpdateInV(Vdec);
myConstraints.UpdateInV(Vdec); myConstraints.UpdateInV(Vdec);
break; break;
case 3 : case 3 :
// Il faut decouper en U et en V // It is necesary to cut in U and V
myResult.UpdateInU(Udec); myResult.UpdateInU(Udec);
myConstraints.UpdateInU(Udec); myConstraints.UpdateInU(Udec);
myResult.UpdateInV(Vdec); myResult.UpdateInV(Vdec);
@ -444,14 +432,14 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
while (myResult.FirstNotApprox(FirstNA)) { while (myResult.FirstNotApprox(FirstNA)) {
// completude de l'ensemble des contraintes // complete the set of constraints
ComputeConstraints(UChoice, VChoice, Func, Crit); ComputeConstraints(UChoice, VChoice, Func, Crit);
if (decision>0) { if (decision>0) {
m0 = m1; m0 = m1;
m1 = 0.; m1 = 0.;
} }
// discretisation des contraintes relatives au carreau // discretize the constraints relative to the square
myResult(FirstNA).Discretise(myConditions,myConstraints,Func); myResult(FirstNA).Discretise(myConditions,myConstraints,Func);
if ( ! myResult(FirstNA).IsDiscretised() ) { if ( ! myResult(FirstNA).IsDiscretised() ) {
myHasResult = myDone = Standard_False; myHasResult = myDone = Standard_False;
@ -459,8 +447,8 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error"); ("AdvApp2Var_ApproxAFunc2Var : Surface Discretisation Error");
} }
// calcul du nombre et du type de decoupes autorisees // calculate the number and type of autorized cuts
// en fonction du nombre de carreaux max et de la validite des decoupes suiv. // depending on the max number of squares and the validity of next cuts
NbU = myResult.NbPatchInU(); NbU = myResult.NbPatchInU();
NbV = myResult.NbPatchInV(); NbV = myResult.NbPatchInV();
NbPatch = NbU*NbV; NbPatch = NbU*NbV;
@ -484,7 +472,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
if ( Umore && Vmore ) NumDec=5; if ( Umore && Vmore ) NumDec=5;
} }
// approximation du carreau // approximation of the square
if ( CritAbs ) { if ( CritAbs ) {
myResult(FirstNA).MakeApprox(myConditions,myConstraints,0); myResult(FirstNA).MakeApprox(myConditions,myConstraints,0);
} }
@ -493,13 +481,13 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
} }
if (NumDec>=3) NumDec = NumDec - 2; if (NumDec>=3) NumDec = NumDec - 2;
// evaluation du critere sur le carreau // evaluation of the criterion on the square
if ( myResult(FirstNA).HasResult() ) { if ( myResult(FirstNA).HasResult() ) {
Crit.Value(myResult(FirstNA),myConditions); Crit.Value(myResult(FirstNA),myConditions);
CritValue = myResult(FirstNA).CritValue(); CritValue = myResult(FirstNA).CritValue();
if (m1<CritValue) m1 = CritValue; if (m1<CritValue) m1 = CritValue;
} }
// doit-on decouper ? // is it necessary to cut ?
decision = myResult(FirstNA).CutSense(Crit,NumDec); decision = myResult(FirstNA).CutSense(Crit,NumDec);
Standard_Boolean Regular = (Crit.Repartition() == AdvApp2Var_Regular); Standard_Boolean Regular = (Crit.Repartition() == AdvApp2Var_Regular);
// Standard_Boolean Regular = Standard_True; // Standard_Boolean Regular = Standard_True;
@ -510,7 +498,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
else { else {
switch (decision) { switch (decision) {
case 0 : case 0 :
// On ne peut plus decouper : on garde le resultat // Impossible to cut : the result is preserved
if ( myResult(FirstNA).HasResult() ) { if ( myResult(FirstNA).HasResult() ) {
myResult(FirstNA).OverwriteApprox(); myResult(FirstNA).OverwriteApprox();
} }
@ -521,17 +509,17 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
} }
break; break;
case 1 : case 1 :
// Il faut decouper en U // It is necessary to cut in U
myResult.UpdateInU(Udec); myResult.UpdateInU(Udec);
myConstraints.UpdateInU(Udec); myConstraints.UpdateInU(Udec);
break; break;
case 2 : case 2 :
// Il faut decouper en V // It is necessary to cut in V
myResult.UpdateInV(Vdec); myResult.UpdateInV(Vdec);
myConstraints.UpdateInV(Vdec); myConstraints.UpdateInV(Vdec);
break; break;
case 3 : case 3 :
// Il faut decouper en U et en V // It is necessary to cut in U and V
myResult.UpdateInU(Udec); myResult.UpdateInU(Udec);
myConstraints.UpdateInU(Udec); myConstraints.UpdateInU(Udec);
myResult.UpdateInV(Vdec); myResult.UpdateInV(Vdec);
@ -565,7 +553,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) { while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) {
// approximation de l'iso et calcul des contraintes aux extremites // approximation of iso and calculation of constraints at extremities
indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2); indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2);
N1 = myConstraints.Node(indN1); N1 = myConstraints.Node(indN1);
indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2); indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2);
@ -577,14 +565,14 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
Func, N1 , N2); Func, N1 , N2);
if (Is.IsApproximated()) { if (Is.IsApproximated()) {
// L'iso est approchee a la tolerance voulue // iso is approached at the required tolerance
myConstraints.ChangeIso(ind1,ind2,Is); myConstraints.ChangeIso(ind1,ind2,Is);
myConstraints.ChangeNode(indN1) = N1; myConstraints.ChangeNode(indN1) = N1;
myConstraints.ChangeNode(indN2) = N2; myConstraints.ChangeNode(indN2) = N2;
} }
else { else {
// Pas d'approximation satisfaisante // Approximation is not satisfactory
NbU = myResult.NbPatchInU(); NbU = myResult.NbPatchInU();
NbV = myResult.NbPatchInV(); NbV = myResult.NbPatchInV();
if (Is.Type()==GeomAbs_IsoV) { if (Is.Type()==GeomAbs_IsoV) {
@ -597,7 +585,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
} }
if (NbPatch<=myMaxPatches && more) { if (NbPatch<=myMaxPatches && more) {
// On peut decouper l'iso // It is possible to cut iso
if (Is.Type()==GeomAbs_IsoV) { if (Is.Type()==GeomAbs_IsoV) {
myResult.UpdateInU(dec); myResult.UpdateInU(dec);
myConstraints.UpdateInU(dec); myConstraints.UpdateInU(dec);
@ -609,7 +597,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
} }
else { else {
// On ne peut plus decouper : on garde le resultat // It is not possible to cut : the result is preserved
if (Is.HasResult()) { if (Is.HasResult()) {
Is.OverwriteApprox(); Is.OverwriteApprox();
myConstraints.ChangeIso(ind1,ind2,Is); myConstraints.ChangeIso(ind1,ind2,Is);
@ -647,7 +635,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) { while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) {
// approximation de l'iso et calcul des contraintes aux extremites // approximation of the iso and calculation of constraints at the extremities
indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2); indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2);
N1 = myConstraints.Node(indN1); N1 = myConstraints.Node(indN1);
indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2); indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2);
@ -659,14 +647,14 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
Func, N1 , N2); Func, N1 , N2);
if (Is.IsApproximated()) { if (Is.IsApproximated()) {
// L'iso est approchee a la tolerance voulue // iso is approached at the required tolerance
myConstraints.ChangeIso(ind1,ind2,Is); myConstraints.ChangeIso(ind1,ind2,Is);
myConstraints.ChangeNode(indN1) = N1; myConstraints.ChangeNode(indN1) = N1;
myConstraints.ChangeNode(indN2) = N2; myConstraints.ChangeNode(indN2) = N2;
} }
else { else {
// Pas d'approximation satisfaisante // Approximation is not satisfactory
NbU = myResult.NbPatchInU(); NbU = myResult.NbPatchInU();
NbV = myResult.NbPatchInV(); NbV = myResult.NbPatchInV();
if (Is.Type()==GeomAbs_IsoV) { if (Is.Type()==GeomAbs_IsoV) {
@ -678,11 +666,11 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
more = VChoice.Value(Is.T0(),Is.T1(),dec); more = VChoice.Value(Is.T0(),Is.T1(),dec);
} }
// Pour forcer l'Overwrite si le critere est Absolu // To force Overwrite if the criterion is Absolute
more = more && (CritRel); more = more && (CritRel);
if (NbPatch<=myMaxPatches && more) { if (NbPatch<=myMaxPatches && more) {
// On peut decouper l'iso // It is possible to cut iso
if (Is.Type()==GeomAbs_IsoV) { if (Is.Type()==GeomAbs_IsoV) {
myResult.UpdateInU(dec); myResult.UpdateInU(dec);
myConstraints.UpdateInU(dec); myConstraints.UpdateInU(dec);
@ -694,7 +682,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
} }
else { else {
// On ne peut plus decouper : on garde le resultat // It is not possible to cut: the result is preserved
if (Is.HasResult()) { if (Is.HasResult()) {
Is.OverwriteApprox(); Is.OverwriteApprox();
myConstraints.ChangeIso(ind1,ind2,Is); myConstraints.ChangeIso(ind1,ind2,Is);
@ -790,14 +778,14 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeCritError()
void AdvApp2Var_ApproxAFunc2Var::ConvertBS() void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
{ {
// Homogeneisation des degres // Homogeneization of degrees
Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder(); Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder();
Standard_Integer ncfu = myConditions.ULimit(), ncfv = myConditions.VLimit(); Standard_Integer ncfu = myConditions.ULimit(), ncfv = myConditions.VLimit();
myResult.SameDegree(iu,iv,ncfu,ncfv); myResult.SameDegree(iu,iv,ncfu,ncfv);
myDegreeInU = ncfu - 1; myDegreeInU = ncfu - 1;
myDegreeInV = ncfv - 1; myDegreeInV = ncfv - 1;
// Calcul des surfaces resultats // Calculate resulting surfaces
mySurfaces = new ( TColGeom_HArray1OfSurface) (1, myNumSubSpaces[2]); mySurfaces = new ( TColGeom_HArray1OfSurface) (1, myNumSubSpaces[2]);
Standard_Integer j; Standard_Integer j;
@ -807,7 +795,7 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
TColStd_Array1OfReal VKnots (1, myResult.NbPatchInV()+1); TColStd_Array1OfReal VKnots (1, myResult.NbPatchInV()+1);
for (j=1; j<=VKnots.Length(); j++) { VKnots.SetValue(j, myResult.VParameter(j)); } for (j=1; j<=VKnots.Length(); j++) { VKnots.SetValue(j, myResult.VParameter(j)); }
// Preparation des donnees pour la conversion grille de polynomes --> poles // Prepare data for conversion grid of polynoms --> poles
Handle(TColStd_HArray1OfReal) Uint1 = Handle(TColStd_HArray1OfReal) Uint1 =
new (TColStd_HArray1OfReal) (1,2); new (TColStd_HArray1OfReal) (1,2);
Uint1->SetValue(1, -1); Uint1->SetValue(1, -1);
@ -835,7 +823,7 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
Standard_Integer SSP, i; Standard_Integer SSP, i;
for (SSP=1; SSP <= myNumSubSpaces[2]; SSP++) { for (SSP=1; SSP <= myNumSubSpaces[2]; SSP++) {
// Creation de la grille de polynomes // Creation of the grid of polynoms
Standard_Integer n=0,icf=1,ieq; Standard_Integer n=0,icf=1,ieq;
for (j=1; j<=myResult.NbPatchInV(); j++) { for (j=1; j<=myResult.NbPatchInV(); j++) {
for (i=1; i<=myResult.NbPatchInU(); i++) { for (i=1; i<=myResult.NbPatchInU(); i++) {
@ -850,13 +838,13 @@ void AdvApp2Var_ApproxAFunc2Var::ConvertBS()
} }
} }
// Conversion en poles // Conversion into poles
Convert_GridPolynomialToPoles CvP (myResult.NbPatchInU(),myResult.NbPatchInV(), Convert_GridPolynomialToPoles CvP (myResult.NbPatchInU(),myResult.NbPatchInV(),
iu,iv,myMaxDegInU,myMaxDegInV,NbCoeff, iu,iv,myMaxDegInU,myMaxDegInV,NbCoeff,
Poly,Uint1,Vint1,Uint2,Vint2); Poly,Uint1,Vint1,Uint2,Vint2);
if ( !CvP.IsDone() ) { myDone = Standard_False; } if ( !CvP.IsDone() ) { myDone = Standard_False; }
// Conversion en BSpline // Conversion into BSpline
mySurfaces->ChangeValue(SSP) = new (Geom_BSplineSurface) mySurfaces->ChangeValue(SSP) = new (Geom_BSplineSurface)
( CvP.Poles()->Array2(), ( CvP.Poles()->Array2(),
CvP.UKnots()->Array1(), CvP.VKnots()->Array1(), CvP.UKnots()->Array1(), CvP.VKnots()->Array1(),

File diff suppressed because it is too large Load Diff

View File

@ -2,50 +2,44 @@
// Created: Tue Jul 2 10:31:42 1996 // Created: Tue Jul 2 10:31:42 1996
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi38> // <jct@sgi38>
// Modified: Mon Dec 9 11:39:13 1996
// by: Joelle CHAUVET
// G1135 : empty constructor
// G1134 : option 0 for precision code
// by PMN
// PRO9093 on remplace MA1NPB par une gestion contextuelle
// pour determiner le degree de Jacobbi.
#include <AdvApp2Var_Context.ixx> #include <AdvApp2Var_Context.ixx>
#include <Standard_ConstructionError.hxx> #include <Standard_ConstructionError.hxx>
#include <AdvApp2Var_ApproxF2var.hxx> #include <AdvApp2Var_ApproxF2var.hxx>
// Calcul des parametres // Calculaton of parameters
static Standard_Boolean lesparam(const Standard_Integer iordre, static Standard_Boolean lesparam(const Standard_Integer iordre,
const Standard_Integer ncflim, const Standard_Integer ncflim,
const Standard_Integer icodeo, const Standard_Integer icodeo,
Standard_Integer& nbpnts, Standard_Integer& nbpnts,
Standard_Integer& ndgjac) Standard_Integer& ndgjac)
{ {
// degree de jacobi // jacobi degree
ndgjac = ncflim; // il toujours garder un coeff en reserve ndgjac = ncflim; // it always keeps a reserve coefficient
if (icodeo< 0) return Standard_False; if (icodeo< 0) return Standard_False;
if (icodeo > 0) { if (icodeo > 0) {
ndgjac += (9 - (iordre+1)); //iordre decale les frequences vers le haut ndgjac += (9 - (iordre+1)); //iordre rescales the frequences upwards
ndgjac += (icodeo-1)*10; ndgjac += (icodeo-1)*10;
} }
// ---> Nbre mini de points necessaires. // ---> Min Number of required pointss.
if (ndgjac < 8) { nbpnts = 8; } if (ndgjac < 8) { nbpnts = 8; }
else if (ndgjac < 10) { nbpnts = 10; } else if (ndgjac < 10) { nbpnts = 10; }
// else if (ndgjac < 15) { nbpnt = 15; } Bug Nombre impairs // else if (ndgjac < 15) { nbpnt = 15; } Bug Uneven number
else if (ndgjac < 20) { nbpnts = 20;} else if (ndgjac < 20) { nbpnts = 20;}
// else if (ndgjac < 25) { nbpnt = 25; } Bug Nombre impairs // else if (ndgjac < 25) { nbpnt = 25; } Bug Uneven number
else if (ndgjac < 30) { nbpnts = 30;} else if (ndgjac < 30) { nbpnts = 30;}
else if (ndgjac < 40) { nbpnts = 40;} else if (ndgjac < 40) { nbpnts = 40;}
else if (ndgjac < 50) { nbpnts = 50;} else if (ndgjac < 50) { nbpnts = 50;}
// else if (*ndgjac < 61) { nbpnt = 61;} Bug Nombre impairs // else if (*ndgjac < 61) { nbpnt = 61;} Bug Uneven number
else { else {
nbpnts = 50; nbpnts = 50;
#if DEB #if DEB
cout << "F(U, V) : Pas assez de point de discretisation" << endl; cout << "F(U, V) : Not enough points of discretization" << endl;
#endif #endif
} }
// Si contraintes aux bords, cela fait 2 points de plus // If constraints are on borders, this adds 2 points
if (iordre>-1) { nbpnts += 2;} if (iordre>-1) { nbpnts += 2;}
return Standard_True; return Standard_True;

View File

@ -103,26 +103,26 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
AdvApp2Var_Node& NodeBegin, AdvApp2Var_Node& NodeBegin,
AdvApp2Var_Node& NodeEnd) AdvApp2Var_Node& NodeEnd)
{ {
// les valeurs fixes // fixed values
Standard_Integer NBCRMX=1, NBCRBE; Standard_Integer NBCRMX=1, NBCRBE;
// les donnees stockees dans le Context // data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE; Standard_Integer NDIMEN, NBSESP, NDIMSE;
NDIMEN = Conditions.TotalDimension(); NDIMEN = Conditions.TotalDimension();
NBSESP = Conditions.TotalNumberSSP(); NBSESP = Conditions.TotalNumberSSP();
// Attention : ne marche que pour le 3D // Attention : works only in 3D
NDIMSE = 3; NDIMSE = 3;
// le domaine de la grille // the domain of the grid
Standard_Real UVFONC[4]; Standard_Real UVFONC[4];
UVFONC[0] = U0; UVFONC[0] = U0;
UVFONC[1] = U1; UVFONC[1] = U1;
UVFONC[2] = V0; UVFONC[2] = V0;
UVFONC[3] = V1; UVFONC[3] = V1;
// les donnees relatives a l'iso a approcher // data related to the processed iso
Standard_Integer IORDRE = myExtremOrder, IDERIV = myDerivOrder; Standard_Integer IORDRE = myExtremOrder, IDERIV = myDerivOrder;
Standard_Real TCONST = myConstPar; Standard_Real TCONST = myConstPar;
// les donnees relatives au type de l'iso // data related to the type of the iso
Standard_Integer ISOFAV,NBROOT,NDGJAC,NCFLIM; Standard_Integer ISOFAV,NBROOT,NDGJAC,NCFLIM;
Standard_Real TABDEC[2]; Standard_Real TABDEC[2];
Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots(); Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots();
@ -162,7 +162,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
//#endif //#endif
} }
// les donnees relatives a la position de l'iso (frontiere ou ligne de decoupe) // data relative to the position of iso (front or cut line)
Handle (TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1,NBSESP); Handle (TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1,NBSESP);
Standard_Integer iesp; Standard_Integer iesp;
switch(myPosition) { switch(myPosition) {
@ -195,7 +195,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
Standard_Real *EPSAPR Standard_Real *EPSAPR
= (Standard_Real *) &HEPSAPR ->ChangeArray1()(HEPSAPR ->Lower()); = (Standard_Real *) &HEPSAPR ->ChangeArray1()(HEPSAPR ->Lower());
// les tableaux des approximations // the tables of approximations
Standard_Integer SZCRB = NDIMEN*NCFLIM; Standard_Integer SZCRB = NDIMEN*NCFLIM;
Handle (TColStd_HArray1OfReal) HCOURBE = Handle (TColStd_HArray1OfReal) HCOURBE =
new TColStd_HArray1OfReal(1,SZCRB*(IDERIV+1)); new TColStd_HArray1OfReal(1,SZCRB*(IDERIV+1));
@ -233,13 +233,13 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
(HERRMOY ->LowerRow(),HERRMOY ->LowerCol()); (HERRMOY ->LowerRow(),HERRMOY ->LowerCol());
Standard_Real *EMYAPP = new Standard_Real[NBSESP]; Standard_Real *EMYAPP = new Standard_Real[NBSESP];
// //
// les approximations // the approximations
// //
Standard_Integer IERCOD=0, NCOEFF=0; Standard_Integer IERCOD=0, NCOEFF=0;
Standard_Integer iapp,ncfapp,ierapp; Standard_Integer iapp,ncfapp,ierapp;
// Standard_Integer id,ic,ideb; // Standard_Integer id,ic,ideb;
for (iapp=0;iapp<=IDERIV;iapp++) { for (iapp=0;iapp<=IDERIV;iapp++) {
// approximation de la derivee d'ordre iapp // approximation of the derivative of order iapp
ncfapp = 0; ncfapp = 0;
ierapp = 0; ierapp = 0;
// GCC 3.0 would not accept this line without the void // GCC 3.0 would not accept this line without the void
@ -271,7 +271,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
EMXAPP, EMXAPP,
EMYAPP, EMYAPP,
&ierapp); &ierapp);
// gestion des erreurs et du nombre de coeff. // error and coefficient management.
if (ierapp>0) { if (ierapp>0) {
myApprIsDone = Standard_False; myApprIsDone = Standard_False;
myHasResult = Standard_False; myHasResult = Standard_False;
@ -279,7 +279,7 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
} }
if (NCOEFF<=ncfapp) NCOEFF=ncfapp; if (NCOEFF<=ncfapp) NCOEFF=ncfapp;
if (ierapp==-1) IERCOD = -1; if (ierapp==-1) IERCOD = -1;
// recuperation des contraintes d'ordre 0 a IORDRE aux extremites // return constraints of order 0 to IORDRE of extremities
Standard_Integer ider, jpos=HCONTR1->Lower(); Standard_Integer ider, jpos=HCONTR1->Lower();
for (ider=0; ider<=IORDRE;ider++) { for (ider=0; ider<=IORDRE;ider++) {
gp_Pnt pt(HCONTR1->Value(jpos), gp_Pnt pt(HCONTR1->Value(jpos),
@ -306,25 +306,25 @@ void AdvApp2Var_Iso::MakeApprox(const AdvApp2Var_Context& Conditions,
} }
jpos+=3; jpos+=3;
} }
// recuperation des erreurs // return errors
for (iesp=1; iesp<=NBSESP;iesp++) { for (iesp=1; iesp<=NBSESP;iesp++) {
HERRMAX->SetValue(iesp,iapp+1,EMXAPP[iesp-1]); HERRMAX->SetValue(iesp,iapp+1,EMXAPP[iesp-1]);
HERRMOY->SetValue(iesp,iapp+1,EMYAPP[iesp-1]); HERRMOY->SetValue(iesp,iapp+1,EMYAPP[iesp-1]);
} }
// passage a l'approximation d'ordre superieur // passage to the approximation of higher order
CRBAPP += SZCRB; CRBAPP += SZCRB;
SOMAPP += SZTAB; SOMAPP += SZTAB;
DIFAPP += SZTAB; DIFAPP += SZTAB;
} }
// gestion des resultats // management of results
if (IERCOD == 0) { if (IERCOD == 0) {
// toutes les approx. sont bonnes // all approximations are correct
myApprIsDone = Standard_True; myApprIsDone = Standard_True;
myHasResult = Standard_True; myHasResult = Standard_True;
} }
else if (IERCOD == -1) { else if (IERCOD == -1) {
// une approx. au moins n'est pas bonne // at least one approximation is not correct
myApprIsDone = Standard_False; myApprIsDone = Standard_False;
myHasResult = Standard_True; myHasResult = Standard_True;
} }

File diff suppressed because it is too large Load Diff

View File

@ -96,15 +96,15 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
const AdvApp2Var_EvaluatorFunc2Var& Func) const AdvApp2Var_EvaluatorFunc2Var& Func)
{ {
// les donnees stockees dans le Context // data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE, ISOFAV; Standard_Integer NDIMEN, NBSESP, NDIMSE, ISOFAV;
NDIMEN = Conditions.TotalDimension(); NDIMEN = Conditions.TotalDimension();
NBSESP = Conditions.TotalNumberSSP(); NBSESP = Conditions.TotalNumberSSP();
// Attention : ne marche que pour le 3D // Attention : works only for 3D
NDIMSE = 3; NDIMSE = 3;
ISOFAV = Conditions.FavorIso(); ISOFAV = Conditions.FavorIso();
// les donnees relatives au patch a discretiser // data related to the patch to be discretized
Standard_Integer NBPNTU, NBPNTV; Standard_Integer NBPNTU, NBPNTV;
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV; Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV;
Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots(); Handle (TColStd_HArray1OfReal) HUROOT = Conditions.URoots();
@ -118,8 +118,8 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
NBPNTV = (Conditions.VRoots())->Length(); NBPNTV = (Conditions.VRoots())->Length();
if (myOrdInV>-1) NBPNTV -= 2; if (myOrdInV>-1) NBPNTV -= 2;
// les donnees stockees dans le Framework Constraints cad Noeuds et Isos // data stored in the Framework Constraints cad Nodes and Isos
// C1, C2, C3 et C4 sont dimensionnes en FORTRAN a (NDIMEN,IORDRU+2,IORDRV+2) // C1, C2, C3 and C4 are dimensionnes in FORTRAN with (NDIMEN,IORDRU+2,IORDRV+2)
Standard_Integer SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2); Standard_Integer SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2);
Handle (TColStd_HArray1OfReal) HCOINS = Handle (TColStd_HArray1OfReal) HCOINS =
new TColStd_HArray1OfReal(1,SIZE*4); new TColStd_HArray1OfReal(1,SIZE*4);
@ -130,10 +130,10 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
for (iu=0;iu<=myOrdInU;iu++) { for (iu=0;iu<=myOrdInU;iu++) {
for (iv=0;iv<=myOrdInV;iv++) { for (iv=0;iv<=myOrdInV;iv++) {
// facteur de normalisation // factor of normalization
rho = pow(du,iu)*pow(dv,iv); rho = pow(du,iu)*pow(dv,iv);
// F(U0,V0) et ses derivees normalisees sur (-1,1) // F(U0,V0) and its derivatives normalized on (-1,1)
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X(); valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X();
HCOINS->SetValue( 1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv , valnorm ); HCOINS->SetValue( 1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv , valnorm );
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Y(); valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Y();
@ -141,7 +141,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z(); valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z();
HCOINS->SetValue( 3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( 3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
// F(U1,V0) et ses derivees normalisees sur (-1,1) // F(U1,V0) and its derivatives normalized on (-1,1)
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X(); valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X();
HCOINS->SetValue( SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Y(); valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Y();
@ -149,7 +149,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z(); valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z();
HCOINS->SetValue( SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
// F(U0,V1) et ses derivees normalisees sur (-1,1) // F(U0,V1) and its derivatives normalized on (-1,1)
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X(); valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X();
HCOINS->SetValue( 2*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( 2*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Y(); valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Y();
@ -157,7 +157,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z(); valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z();
HCOINS->SetValue( 2*SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( 2*SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
// F(U1,V1) et ses derivees normalisees sur (-1,1) // F(U1,V1) and its derivatives normalized on (-1,1)
valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X(); valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X();
HCOINS->SetValue( 3*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm ); HCOINS->SetValue( 3*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Y(); valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Y();
@ -172,8 +172,8 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
Standard_Real *C3 = C2 + SIZE; Standard_Real *C3 = C2 + SIZE;
Standard_Real *C4 = C3 + SIZE; Standard_Real *C4 = C3 + SIZE;
// tableaux SomTab et Diftab de discretisation des isos U=U0 et U=U1 // tables SomTab and Diftab of discretization of isos U=U0 and U=U1
// SU0, SU1, DU0 et DU1 sont dimensionnes en FORTRAN a // SU0, SU1, DU0 and DU1 are dimensioned in FORTRAN to
// (1+NBPNTV/2)*NDIMEN*(IORDRU+1) // (1+NBPNTV/2)*NDIMEN*(IORDRU+1)
SIZE = (1+NBPNTV/2)*NDIMEN; SIZE = (1+NBPNTV/2)*NDIMEN;
@ -198,7 +198,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
HDU1 ->ChangeArray1() = HDU1 ->ChangeArray1() =
( (Constraints.IsoU(myU1,myV0,myV1)).DifTab() ) ->Array1(); ( (Constraints.IsoU(myU1,myV0,myV1)).DifTab() ) ->Array1();
// normalisation // normalization
Standard_Integer ideb1,ideb2,ideb3,ideb4,jj; Standard_Integer ideb1,ideb2,ideb3,ideb4,jj;
for (iu=1;iu<=IORDRU;iu++) { for (iu=1;iu<=IORDRU;iu++) {
rho = pow(du,iu); rho = pow(du,iu);
@ -223,8 +223,8 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
Standard_Real *DU1 = Standard_Real *DU1 =
(Standard_Real *) &HDU1 ->ChangeArray1()(HDU1 ->Lower()); (Standard_Real *) &HDU1 ->ChangeArray1()(HDU1 ->Lower());
// tableaux SomTab et Diftab de discretisation des isos V=V0 et V=V1 // tables SomTab and Diftab of discretization of isos V=V0 and V=V1
// SU0, SU1, DU0 et DU1 sont dimensionnes en FORTRAN a // SU0, SU1, DU0 and DU1 are dimensioned in FORTRAN at
// (1+NBPNTU/2)*NDIMEN*(IORDRV+1) // (1+NBPNTU/2)*NDIMEN*(IORDRV+1)
SIZE = (1+NBPNTU/2)*NDIMEN; SIZE = (1+NBPNTU/2)*NDIMEN;
@ -273,7 +273,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
Standard_Real *DV1 = Standard_Real *DV1 =
(Standard_Real *) &HDV1 ->ChangeArray1()(HDV1 ->Lower()); (Standard_Real *) &HDV1 ->ChangeArray1()(HDV1 ->Lower());
// SOSOTB et DIDITB sont dimensionnes en FORTRAN a // SOSOTB and DIDITB are dimensioned in FORTRAN at
// (0:NBPNTU/2,0:NBPNTV/2,NDIMEN) // (0:NBPNTU/2,0:NBPNTV/2,NDIMEN)
SIZE=(1+NBPNTU/2)*(1+NBPNTV/2)*NDIMEN; SIZE=(1+NBPNTU/2)*(1+NBPNTV/2)*NDIMEN;
@ -289,7 +289,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
(Standard_Real *) &HDIDI ->ChangeArray1()(HDIDI ->Lower()); (Standard_Real *) &HDIDI ->ChangeArray1()(HDIDI ->Lower());
HDIDI->Init(0.); HDIDI->Init(0.);
// SODITB et DISOTB sont dimensionnes en FORTRAN a // SODITB and DISOTB are dimensioned in FORTRAN at
// (1:NBPNTU/2,1:NBPNTV/2,NDIMEN) // (1:NBPNTU/2,1:NBPNTV/2,NDIMEN)
SIZE=(NBPNTU/2)*(NBPNTV/2)*NDIMEN; SIZE=(NBPNTU/2)*(NBPNTV/2)*NDIMEN;
@ -307,12 +307,12 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
Standard_Integer IERCOD=0; Standard_Integer IERCOD=0;
// discretisation des polynomes d'interpolation // discretization of polynoms of interpolation
AdvApp2Var_ApproxF2var::mma2cdi_(&NDIMEN,&NBPNTU,UROOT,&NBPNTV,VROOT,&IORDRU,&IORDRV, AdvApp2Var_ApproxF2var::mma2cdi_(&NDIMEN,&NBPNTU,UROOT,&NBPNTV,VROOT,&IORDRU,&IORDRV,
C1,C2,C3,C4,SU0,SU1,DU0,DU1,SV0,SV1,DV0,DV1, C1,C2,C3,C4,SU0,SU1,DU0,DU1,SV0,SV1,DV0,DV1,
SOSOTB,SODITB,DISOTB,DIDITB,&IERCOD); SOSOTB,SODITB,DISOTB,DIDITB,&IERCOD);
// discretisation du carreau // discretization of the square
Standard_Real UDBFN[2],VDBFN[2]; Standard_Real UDBFN[2],VDBFN[2];
UDBFN[0] = myU0; UDBFN[0] = myU0;
UDBFN[1] = myU1; UDBFN[1] = myU1;
@ -350,7 +350,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
TAB, TAB,
&IERCOD); &IERCOD);
// on stocke les resultats // the results are stored
if (IERCOD == 0) { if (IERCOD == 0) {
myDiscIsDone = Standard_True; myDiscIsDone = Standard_True;
mySosoTab = HSOSO; mySosoTab = HSOSO;
@ -391,24 +391,24 @@ Standard_Boolean AdvApp2Var_Patch::IsApproximated() const
void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
const AdvApp2Var_Framework& Constraints) const AdvApp2Var_Framework& Constraints)
{ {
// les donnees stockees dans le Context // data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE; Standard_Integer NDIMEN, NBSESP, NDIMSE;
Standard_Integer IERCOD, NCFLMU, NCFLMV, NDegU, NDegV; Standard_Integer IERCOD, NCFLMU, NCFLMV, NDegU, NDegV;
NDIMEN = Conditions.TotalDimension(); NDIMEN = Conditions.TotalDimension();
NBSESP = Conditions.TotalNumberSSP(); NBSESP = Conditions.TotalNumberSSP();
// Attention : ne marche que pour le 3D // Attention : works only for 3D
NDIMSE = 3; NDIMSE = 3;
NCFLMU = Conditions.ULimit(); NCFLMU = Conditions.ULimit();
NCFLMV = Conditions.VLimit(); NCFLMV = Conditions.VLimit();
NDegU = NCFLMU - 1; NDegU = NCFLMU - 1;
NDegV = NCFLMV - 1; NDegV = NCFLMV - 1;
// les donnees relatives au patch a approcher // data relative to the patch
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV; Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV;
Standard_Real *PATCAN = Standard_Real *PATCAN =
(Standard_Real *) &myEquation ->ChangeArray1()(myEquation ->Lower()); (Standard_Real *) &myEquation ->ChangeArray1()(myEquation ->Lower());
// les courbes d'approximation des Isos U // curves of approximation of Isos U
Standard_Integer SIZE = NCFLMV*NDIMEN; Standard_Integer SIZE = NCFLMV*NDIMEN;
Handle (TColStd_HArray1OfReal) HIsoU0 Handle (TColStd_HArray1OfReal) HIsoU0
= new TColStd_HArray1OfReal(1,SIZE*(IORDRU+1)); = new TColStd_HArray1OfReal(1,SIZE*(IORDRU+1));
@ -434,7 +434,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
(Standard_Integer *) &HCFU1 ->ChangeArray1()(HCFU1 ->Lower()); (Standard_Integer *) &HCFU1 ->ChangeArray1()(HCFU1 ->Lower());
HCFU1->Init( (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff() ); HCFU1->Init( (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff() );
// normalisation des Isos U // normalization of Isos U
Standard_Integer iu,iv; Standard_Integer iu,iv;
Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm; Standard_Real du=(myU1-myU0)/2,dv=(myV1-myV0)/2,rho,valnorm;
Standard_Integer ideb0,ideb1,jj; Standard_Integer ideb0,ideb1,jj;
@ -449,7 +449,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
} }
} }
// les courbes d'approximation des Isos V // curves of approximation of Isos V
SIZE = NCFLMU*NDIMEN; SIZE = NCFLMU*NDIMEN;
Handle (TColStd_HArray1OfReal) HIsoV0 Handle (TColStd_HArray1OfReal) HIsoV0
= new TColStd_HArray1OfReal(1,SIZE*(IORDRV+1)); = new TColStd_HArray1OfReal(1,SIZE*(IORDRV+1));
@ -475,7 +475,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
(Standard_Integer *) &HCFV1 ->ChangeArray1()(HCFV1 ->Lower()); (Standard_Integer *) &HCFV1 ->ChangeArray1()(HCFV1 ->Lower());
HCFV1->Init( (Constraints.IsoV(myU0,myU1,myV1)).NbCoeff() ); HCFV1->Init( (Constraints.IsoV(myU0,myU1,myV1)).NbCoeff() );
// normalisation des Isos V // normalization of Isos V
for (iv=1;iv<=IORDRV;iv++) { for (iv=1;iv<=IORDRV;iv++) {
rho = pow(dv,iv); rho = pow(dv,iv);
ideb0 = HIsoV0->Lower() + iv*SIZE -1; ideb0 = HIsoV0->Lower() + iv*SIZE -1;
@ -486,7 +486,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
} }
} }
// ajout des contraintes a V constant // add constraints to constant V
Handle (TColStd_HArray1OfReal) HHERMV Handle (TColStd_HArray1OfReal) HHERMV
= new TColStd_HArray1OfReal(1,(2*IORDRV+2)*(2*IORDRV+2)); = new TColStd_HArray1OfReal(1,(2*IORDRV+2)*(2*IORDRV+2));
Standard_Real *HermV = Standard_Real *HermV =
@ -510,7 +510,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
PATCAN); PATCAN);
} }
// ajout des contraintes a U constant // add constraints to constant U
Handle (TColStd_HArray1OfReal) HHERMU Handle (TColStd_HArray1OfReal) HHERMU
= new TColStd_HArray1OfReal(1,(2*IORDRU+2)*(2*IORDRU+2)); = new TColStd_HArray1OfReal(1,(2*IORDRU+2)*(2*IORDRU+2));
Standard_Real *HermU = Standard_Real *HermU =
@ -525,7 +525,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
NCFU0,IsoU0,NCFU1,IsoU1,HermU,PATCAN); NCFU0,IsoU0,NCFU1,IsoU1,HermU,PATCAN);
} }
// ajout des contraintes de coins // add constraints at the corners
Standard_Integer ideb; Standard_Integer ideb;
SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2); SIZE=NDIMEN*(IORDRU+2)*(IORDRV+2);
Handle (TColStd_HArray1OfReal) HCOINS = Handle (TColStd_HArray1OfReal) HCOINS =
@ -535,7 +535,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
for (iv=0;iv<=myOrdInV;iv++) { for (iv=0;iv<=myOrdInV;iv++) {
rho = pow(du,iu)*pow(dv,iv); rho = pow(du,iu)*pow(dv,iv);
// -F(U0,V0) et ses derivees normalisees sur (-1,1) // -F(U0,V0) and its derivatives normalized on (-1,1)
ideb = HCOINS->Lower() + NDIMEN*iu+NDIMEN*(IORDRU+2)*iv - 1; ideb = HCOINS->Lower() + NDIMEN*iu+NDIMEN*(IORDRU+2)*iv - 1;
valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X(); valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X();
HCOINS->SetValue( 1+ideb , valnorm ); HCOINS->SetValue( 1+ideb , valnorm );
@ -544,7 +544,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z(); valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z();
HCOINS->SetValue( 3+ideb , valnorm ); HCOINS->SetValue( 3+ideb , valnorm );
// -F(U1,V0) et ses derivees normalisees sur (-1,1) // -F(U1,V0) and its derivatives normalized on (-1,1)
ideb += SIZE; ideb += SIZE;
valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X(); valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X();
HCOINS->SetValue( 1+ideb , valnorm ); HCOINS->SetValue( 1+ideb , valnorm );
@ -553,7 +553,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z(); valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z();
HCOINS->SetValue( 3+ideb , valnorm ); HCOINS->SetValue( 3+ideb , valnorm );
// -F(U0,V1) et ses derivees normalisees sur (-1,1) // -F(U0,V1) and its derivatives normalized on (-1,1)
ideb += SIZE; ideb += SIZE;
valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X(); valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X();
HCOINS->SetValue( 1+ideb , valnorm ); HCOINS->SetValue( 1+ideb , valnorm );
@ -562,7 +562,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z(); valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z();
HCOINS->SetValue( 3+ideb , valnorm ); HCOINS->SetValue( 3+ideb , valnorm );
// -F(U1,V1) et ses derivees normalisees sur (-1,1) // -F(U1,V1) and its derivatives normalized on (-1,1)
ideb += SIZE; ideb += SIZE;
valnorm = -rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X(); valnorm = -rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X();
HCOINS->SetValue( 1+ideb , valnorm ); HCOINS->SetValue( 1+ideb , valnorm );
@ -573,7 +573,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
} }
} }
// tableaux necessaires pour le FORTRAN // tables required for FORTRAN
Standard_Integer IORDMX = Max(IORDRU,IORDRV); Standard_Integer IORDMX = Max(IORDRU,IORDRV);
Handle (TColStd_HArray1OfReal) HEXTR = Handle (TColStd_HArray1OfReal) HEXTR =
new TColStd_HArray1OfReal(1,2*IORDMX+2); new TColStd_HArray1OfReal(1,2*IORDMX+2);
@ -587,7 +587,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
Standard_Integer idim,ncf0,ncf1,iun=1; Standard_Integer idim,ncf0,ncf1,iun=1;
Standard_Real *Is; Standard_Real *Is;
// ajout des extremites des isos U // add extremities of isos U
for (iu=1;iu<=IORDRU+1;iu++) { for (iu=1;iu<=IORDRU+1;iu++) {
ncf0 = HCFU0->Value(HCFU0->Lower()+iu-1); ncf0 = HCFU0->Value(HCFU0->Lower()+iu-1);
ncf1 = HCFU1->Value(HCFU1->Lower()+iu-1); ncf1 = HCFU1->Value(HCFU1->Lower()+iu-1);
@ -609,7 +609,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
} }
} }
// ajout des extremites des isos V // add extremities of isos V
for (iv=1;iv<=IORDRV+1;iv++) { for (iv=1;iv<=IORDRV+1;iv++) {
ncf0 = HCFV0->Value(HCFV0->Lower()+iv-1); ncf0 = HCFV0->Value(HCFV0->Lower()+iv-1);
ncf1 = HCFV1->Value(HCFV1->Lower()+iv-1); ncf1 = HCFV1->Value(HCFV1->Lower()+iv-1);
@ -631,7 +631,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
} }
} }
// ajout du tout a PATCAN // add all to PATCAN
Standard_Real *C1 = Standard_Real *C1 =
(Standard_Real *) &HCOINS ->ChangeArray1()(HCOINS ->Lower()); (Standard_Real *) &HCOINS ->ChangeArray1()(HCOINS ->Lower());
Standard_Real *C2 = C1 + SIZE; Standard_Real *C2 = C1 + SIZE;
@ -660,7 +660,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
hmax[3] = 1.75; hmax[3] = 1.75;
for (iesp=1;iesp<=NBSESP;iesp++) { for (iesp=1;iesp<=NBSESP;iesp++) {
// erreur max dans le sous-espace iesp // error max in sub-space iesp
errU=0.; errU=0.;
for (iv=1;iv<=myOrdInV+1;iv++) { for (iv=1;iv<=myOrdInV+1;iv++) {
error = ((Constraints.IsoV(myU0,myU1,myV0)).MaxErrors())->Value(iesp,iv); error = ((Constraints.IsoV(myU0,myU1,myV0)).MaxErrors())->Value(iesp,iv);
@ -678,7 +678,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
myMaxErrors->ChangeValue(iesp) += myMaxErrors->ChangeValue(iesp) +=
errU * hmax[myOrdInV+1] + errV * hmax[myOrdInU+1]; errU * hmax[myOrdInV+1] + errV * hmax[myOrdInU+1];
// erreur moyenne dans le sous-espace iesp // average error in sub-space iesp
errU=0.; errU=0.;
for (iv=1;iv<=myOrdInV+1;iv++) { for (iv=1;iv<=myOrdInV+1;iv++) {
error = ((Constraints.IsoV(myU0,myU1,myV0)).MoyErrors())->Value(iesp,iv); error = ((Constraints.IsoV(myU0,myU1,myV0)).MoyErrors())->Value(iesp,iv);
@ -699,7 +699,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
+ errV*hmax[myOrdInU+1] * errV*hmax[myOrdInU+1]; + errV*hmax[myOrdInU+1] * errV*hmax[myOrdInU+1];
myMoyErrors->SetValue(iesp,Sqrt(error)); myMoyErrors->SetValue(iesp,Sqrt(error));
// erreurs maxi aux iso-frontieres // max errors at iso-borders
Handle (TColStd_HArray2OfReal) HERISO Handle (TColStd_HArray2OfReal) HERISO
= new TColStd_HArray2OfReal(1,NBSESP,1,4); = new TColStd_HArray2OfReal(1,NBSESP,1,4);
HERISO->SetValue(iesp,1, HERISO->SetValue(iesp,1,
@ -711,7 +711,7 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
HERISO->SetValue(iesp,4, HERISO->SetValue(iesp,4,
((Constraints.IsoU(myU1,myV0,myV1)).MaxErrors())->Value(iesp,1)); ((Constraints.IsoU(myU1,myV0,myV1)).MaxErrors())->Value(iesp,1));
// calcul des erreurs max aux coins // calculate max errors at the corners
Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1,err2,err3,err4; Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1,err2,err3,err4;
for (iu=0;iu<=myOrdInU;iu++) { for (iu=0;iu<=myOrdInU;iu++) {
for (iv=0;iv<=myOrdInV;iv++) { for (iv=0;iv<=myOrdInV;iv++) {
@ -726,13 +726,13 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
} }
} }
// calcul des erreurs max sur les bords // calculate max errors on borders
err1 = Max(emax1,emax2); err1 = Max(emax1,emax2);
err2 = Max(emax3,emax4); err2 = Max(emax3,emax4);
err3 = Max(emax1,emax3); err3 = Max(emax1,emax3);
err4 = Max(emax2,emax4); err4 = Max(emax2,emax4);
// calcul des erreurs finales sur les isos internes // calculate final errors on internal isos
if ( (Constraints.IsoV(myU0,myU1,myV0)).Position() == 0 ) { if ( (Constraints.IsoV(myU0,myU1,myV0)).Position() == 0 ) {
HERISO ->ChangeValue(iesp,1) += err1*hmax[myOrdInU+1]; HERISO ->ChangeValue(iesp,1) += err1*hmax[myOrdInU+1];
} }
@ -759,7 +759,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
const Standard_Integer NumDec) const Standard_Integer NumDec)
{ {
// les donnees stockees dans le Context // data stored in the Context
Standard_Integer NDIMEN, NBSESP, NDIMSE; Standard_Integer NDIMEN, NBSESP, NDIMSE;
Standard_Integer NBPNTU, NBPNTV, NCFLMU, NCFLMV, NDJACU, NDJACV; Standard_Integer NBPNTU, NBPNTV, NCFLMU, NCFLMV, NDJACU, NDJACV;
Standard_Integer NDegU, NDegV, NJacU, NJacV; Standard_Integer NDegU, NDegV, NJacU, NJacV;
@ -779,11 +779,11 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
NJacU = NDJACU + 1; NJacU = NDJACU + 1;
NJacV = NDJACV + 1; NJacV = NDJACV + 1;
// les donnees relatives au patch a approcher // data relative to the processed patch
Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV, Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV,
NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV; NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV;
// NDMINU et NDMINV dependent du nb de coeff des isos voisines // NDMINU and NDMINV depend on the nb of coeff of neighboring isos
// et de l'ordre de continuite souhaite // and of the required order of continuity
NDMINU = Max(1,2*IORDRU+1); NDMINU = Max(1,2*IORDRU+1);
NCOEFU = (Constraints.IsoV(myU0,myU1,myV0)).NbCoeff()-1; NCOEFU = (Constraints.IsoV(myU0,myU1,myV0)).NbCoeff()-1;
NDMINU = Max(NDMINU,NCOEFU); NDMINU = Max(NDMINU,NCOEFU);
@ -796,7 +796,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
NCOEFV = (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff()-1; NCOEFV = (Constraints.IsoU(myU1,myV0,myV1)).NbCoeff()-1;
NDMINV = Max(NDMINV,NCOEFV); NDMINV = Max(NDMINV,NCOEFV);
// les tableaux des approximations // tables of approximations
Handle (TColStd_HArray1OfReal) HEPSAPR = Handle (TColStd_HArray1OfReal) HEPSAPR =
new TColStd_HArray1OfReal(1,NBSESP); new TColStd_HArray1OfReal(1,NBSESP);
Handle (TColStd_HArray1OfReal) HEPSFRO = Handle (TColStd_HArray1OfReal) HEPSFRO =
@ -842,7 +842,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
Standard_Real *ERRMOY = Standard_Real *ERRMOY =
(Standard_Real *) &HERRMOY ->ChangeArray1()(HERRMOY ->Lower()); (Standard_Real *) &HERRMOY ->ChangeArray1()(HERRMOY ->Lower());
// les tableaux de discretisation du carreau // tables of discretization of the square
Standard_Real *SOSOTB = Standard_Real *SOSOTB =
(Standard_Real *) &mySosoTab ->ChangeArray1()(mySosoTab ->Lower()); (Standard_Real *) &mySosoTab ->ChangeArray1()(mySosoTab ->Lower());
Standard_Real *DISOTB = Standard_Real *DISOTB =
@ -884,7 +884,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
&ITYDEC, &ITYDEC,
&IERCOD); &IERCOD);
// les resultats // results
myCutSense = ITYDEC; myCutSense = ITYDEC;
if (ITYDEC == 0 && IERCOD<=0) { if (ITYDEC == 0 && IERCOD<=0) {
myHasResult = Standard_True; myHasResult = Standard_True;
@ -894,7 +894,7 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
myMaxErrors = HERRMAX; myMaxErrors = HERRMAX;
myMoyErrors = HERRMOY; myMoyErrors = HERRMOY;
// Passage en canonique sur [-1,1] // Passage to canonic on [-1,1]
AdvApp2Var_MathBase::mmfmca9_(&NJacU,&NJacV,&NDIMEN,&myNbCoeffInU,&myNbCoeffInV, AdvApp2Var_MathBase::mmfmca9_(&NJacU,&NJacV,&NDIMEN,&myNbCoeffInU,&myNbCoeffInV,
&NDIMEN,PATJAC,PATJAC); &NDIMEN,PATJAC,PATJAC);
AdvApp2Var_ApproxF2var::mma2can_(&NCFLMU,&NCFLMV,&NDIMEN, AdvApp2Var_ApproxF2var::mma2can_(&NCFLMU,&NCFLMV,&NDIMEN,
@ -907,11 +907,11 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions,
} }
myEquation = HPCAN; myEquation = HPCAN;
// Ajout des contraintes et des erreurs // Add constraints and errors
AddConstraints(Conditions,Constraints); AddConstraints(Conditions,Constraints);
AddErrors(Constraints); AddErrors(Constraints);
// Reduction des degres si possible // Reduction of degrees if possible
PATCAN = (Standard_Real *) PATCAN = (Standard_Real *)
&myEquation->ChangeArray1()(myEquation ->Lower()); &myEquation->ChangeArray1()(myEquation ->Lower());
@ -969,7 +969,7 @@ void AdvApp2Var_Patch::ChangeDomain(const Standard_Real a,
//============================================================================ //============================================================================
//function : ResetApprox //function : ResetApprox
//purpose : permet d'effacer un resultat lorsqu'il faut decouper //purpose : allows removing a result when it is necessary to cut
//============================================================================ //============================================================================
void AdvApp2Var_Patch::ResetApprox() void AdvApp2Var_Patch::ResetApprox()
@ -980,8 +980,7 @@ void AdvApp2Var_Patch::ResetApprox()
//============================================================================ //============================================================================
//function : OverwriteApprox //function : OverwriteApprox
//purpose : permet de conserver un resultat //purpose : allows preserving a result even if the precision is not satisfactory
// meme si la precision n'est pas satisfaite
//============================================================================ //============================================================================
void AdvApp2Var_Patch::OverwriteApprox() void AdvApp2Var_Patch::OverwriteApprox()
@ -1052,9 +1051,9 @@ Standard_Integer AdvApp2Var_Patch::VOrder() const
//============================================================================ //============================================================================
//function : CutSense sans Critere //function : CutSense without Critere
//purpose : 0 : OK; 1 : decoupe necessaire en U; //purpose : 0 : OK; 1 : required cut by U;
// 2 : dec. nec. en V; 3 : dec. nec. en U et en V // 2 : required cut by V; 3 : required cut by U and by V
//============================================================================ //============================================================================
Standard_Integer AdvApp2Var_Patch::CutSense() const Standard_Integer AdvApp2Var_Patch::CutSense() const
@ -1064,9 +1063,9 @@ Standard_Integer AdvApp2Var_Patch::CutSense() const
//============================================================================ //============================================================================
//function : CutSense avec critere //function : CutSense with critere
//purpose : 0 : OK; 1 : decoupe necessaire en U; //purpose : 0 : OK; 1 : required cut by U;
// 2 : dec. nec. en V; 3 : dec. nec. en U et en V // 2 : required cut by V; 3 : required cut by U and by V
//============================================================================ //============================================================================
Standard_Integer AdvApp2Var_Patch::CutSense(const AdvApp2Var_Criterion& Crit, Standard_Integer AdvApp2Var_Patch::CutSense(const AdvApp2Var_Criterion& Crit,
@ -1109,7 +1108,7 @@ Standard_Integer AdvApp2Var_Patch::NbCoeffInV() const
//============================================================================ //============================================================================
//function : ChangeNbCoeff //function : ChangeNbCoeff
//purpose : permet d'augmenter le nombre de coeff (cf Network) //purpose : allows increasing the nb of coeff (cf Network)
//============================================================================ //============================================================================
void AdvApp2Var_Patch::ChangeNbCoeff(const Standard_Integer NbCoeffU, void AdvApp2Var_Patch::ChangeNbCoeff(const Standard_Integer NbCoeffU,
@ -1121,7 +1120,7 @@ void AdvApp2Var_Patch::ChangeNbCoeff(const Standard_Integer NbCoeffU,
//============================================================================ //============================================================================
//function : MaxErrors //function : MaxErrors
//purpose : retourne les erreurs max de l'approximation polynomiale //purpose : returns max errors of polynomial approximation
//============================================================================ //============================================================================
Handle(TColStd_HArray1OfReal) Handle(TColStd_HArray1OfReal)
@ -1132,7 +1131,7 @@ AdvApp2Var_Patch::MaxErrors() const
//============================================================================ //============================================================================
//function : AverageErrors //function : AverageErrors
//purpose : retourne les erreurs moyennes de l'approximation polynomiale //purpose : returns average errors of polynomial approximation
//============================================================================ //============================================================================
Handle(TColStd_HArray1OfReal) Handle(TColStd_HArray1OfReal)
@ -1143,7 +1142,7 @@ AdvApp2Var_Patch::AverageErrors() const
//============================================================================ //============================================================================
//function : IsoErrors //function : IsoErrors
//purpose : retourne les erreurs max sur les frontieres de l'approx. polyn. //purpose : returns max errors on borders of polynomial approximation
//============================================================================ //============================================================================
Handle(TColStd_HArray2OfReal) Handle(TColStd_HArray2OfReal)
@ -1154,7 +1153,7 @@ AdvApp2Var_Patch::IsoErrors() const
//============================================================================ //============================================================================
//function : Poles //function : Poles
//purpose : retourne les poles de l'approximation polynomiale //purpose : returns poles of the polynomial approximation
//============================================================================ //============================================================================
Handle(TColgp_HArray2OfPnt) Handle(TColgp_HArray2OfPnt)
@ -1195,7 +1194,7 @@ AdvApp2Var_Patch::Poles(const Standard_Integer SSPIndex,
//============================================================================ //============================================================================
//function : Coefficients //function : Coefficients
//purpose : retourne les coeff. de l'equation de l'approximation polynomiale //purpose : returns coeff. of the equation of polynomial approximation
//============================================================================ //============================================================================
Handle(TColStd_HArray1OfReal) Handle(TColStd_HArray1OfReal)

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
#endif /*__AppBlend_API*/ #endif /*__AppBlend_API*/
//**************************************************** //****************************************************
// Fonctions permettant de changer le type des approx. // Functions to change the type of approx.
//**************************************************** //****************************************************
static Standard_Boolean AppBlend_ContextSplineApprox = Standard_False; static Standard_Boolean AppBlend_ContextSplineApprox = Standard_False;

View File

@ -1,6 +1,4 @@
// AppDef_MyLineTool.cxx // AppDef_MyLineTool.cxx
// 24-06-96 : JPI : implementation des methodes AppDef_MyLineTool::Curvature
// pour le lissage variationnel
#include <AppDef_MyLineTool.ixx> #include <AppDef_MyLineTool.ixx>
#include <AppDef_MultiPointConstraint.hxx> #include <AppDef_MultiPointConstraint.hxx>

View File

@ -1,5 +1,5 @@
//File AppParCurves_MultiCurve.cxx //File AppParCurves_MultiCurve.cxx
//Lpa, le 3/12/91
#include <AppParCurves_MultiCurve.ixx> #include <AppParCurves_MultiCurve.ixx>
#include <TColgp_Array1OfPnt.hxx> #include <TColgp_Array1OfPnt.hxx>

View File

@ -1,5 +1,4 @@
//File AppParCurves_MultiPoint.cxx //File AppParCurves_MultiPoint.cxx
//Lpa, le 3/12/91
#include <AppParCurves_MultiPoint.ixx> #include <AppParCurves_MultiPoint.ixx>

View File

@ -35,8 +35,7 @@ static Standard_Boolean AffichFw = Standard_False;
static Standard_Integer NbCurve = 0; static Standard_Integer NbCurve = 0;
#endif #endif
// //
// sert a tester si Extrema raconte pas des betises // allows testing if Extrema produces correct results/
//
static void ProjectPointOnCurve(const Standard_Real InitValue, static void ProjectPointOnCurve(const Standard_Real InitValue,
@ -204,9 +203,9 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
#ifdef DEB #ifdef DEB
if (Voir) { if (Voir) {
cout<<endl; cout<<endl;
cout<<"Controle du changement de variable : "<<endl; cout<<"Control the change of variable : "<<endl;
cout<<"baillement mesure par projection : "<<d<<endl; cout<<"yawn mesured by projection : "<<d<<endl;
cout<<"Nombre de points : "<<nbp<<endl; cout<<"Number of points : "<<nbp<<endl;
} }
#endif #endif
#if 0 #if 0
@ -226,8 +225,8 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
dglis = sqrt(dglis); dglis = sqrt(dglis);
#ifdef DEB #ifdef DEB
if ( Voir) { if ( Voir) {
cout<<"glissement de parametre aux points imposes : "<<glis<<endl; cout<<"shift of parameter to the imposed points : "<<glis<<endl;
cout<<"distance de glissement aux points imposes : "<<dglis<<endl; cout<<"shift distance at the imposed points : "<<dglis<<endl;
} }
#endif #endif
dglis = 0.; dglis = 0.;
@ -281,7 +280,7 @@ static Standard_Boolean Check(const TColStd_Array1OfReal& FlatKnots,
tol = sqrt(d2); tol = sqrt(d2);
#ifdef DEB #ifdef DEB
if (Voir) if (Voir)
cout<<"distance max sur "<<nn<<" points : "<<tol<<endl<<endl; cout<<"distance max on "<<nn<<" points : "<<tol<<endl<<endl;
#endif #endif
return ((tol <= d) || (tol > 0.8 * oldtol)); return ((tol <= d) || (tol > 0.8 * oldtol));
} }
@ -359,9 +358,9 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if(Continuity > GeomAbs_C1) Continuity = GeomAbs_C1; if(Continuity > GeomAbs_C1) Continuity = GeomAbs_C1;
//On controle les tangentes aux extremites pour savoir si le //Control tangents at the extremities to know if the
//reparametrage est possible et on calcule les tangentes aux //reparametring is possible and calculate the tangents
//extremites de la fonction de changement de variable. //at the extremities of the function of change of variable.
Standard_Real tangent[2]; Standard_Real tangent[2];
gp_Pnt Pcons,Pc3d; gp_Pnt Pcons,Pc3d;
gp_Vec Vcons,Vc3d; gp_Vec Vcons,Vc3d;
@ -399,8 +398,8 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if(dmax2 > besttol2) besttol2 = dmax2; if(dmax2 > besttol2) besttol2 = dmax2;
//On prend un multiple de l echantillon du CheckShape, //Take a multiple of the sample pof CheckShape,
//au moins les points de controle seront bons. No comment!!! //at least the control points will be correct. No comment!!!
Standard_Integer NCONTROL = 22; Standard_Integer NCONTROL = 22;
#ifdef DEB #ifdef DEB
@ -409,8 +408,8 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
Standard_Boolean interpolok = 0; Standard_Boolean interpolok = 0;
Standard_Real tolsov = 1.e200; Standard_Real tolsov = 1.e200;
//On prend des parametres a pas constant sur la curve on surface //Take parameters with constant step on the curve on surface
//et sur la courbe 3d. //and on curve 3d.
Standard_Real deltacons = lcons - fcons; Standard_Real deltacons = lcons - fcons;
deltacons /= (NCONTROL); deltacons /= (NCONTROL);
Standard_Real deltac3d = lc3d - fc3d; Standard_Real deltac3d = lc3d - fc3d;
@ -530,10 +529,10 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
return; return;
} }
if(!extrok) { // Si pas deja SameP et tgte aux fraise, on abandonne. if(!extrok) { // If not already SameP and tangent to mill, abandon.
mySameParameter = Standard_False; mySameParameter = Standard_False;
#ifdef DEB #ifdef DEB
cout<<"SameParameter probleme : tangente nulle aux extremites"<<endl; cout<<"SameParameter problem : zero tangent to extremities"<<endl;
#endif #endif
return; return;
} }
@ -563,7 +562,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
#endif #endif
while(!interpolok){ while(!interpolok){
// Les tableaux et leurs bornes pour l interpolation. // The tables and their limits for the interpolation.
Standard_Integer num_knots = count + 7; Standard_Integer num_knots = count + 7;
Standard_Integer num_poles = count + 3; Standard_Integer num_poles = count + 3;
TColStd_Array1OfReal Paramc3d(*pc3d,1,count+1); TColStd_Array1OfReal Paramc3d(*pc3d,1,count+1);
@ -573,7 +572,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
TColStd_Array1OfReal InterpolationParameters(1,num_poles) ; TColStd_Array1OfReal InterpolationParameters(1,num_poles) ;
TColStd_Array1OfReal FlatKnots(1,num_knots) ; TColStd_Array1OfReal FlatKnots(1,num_knots) ;
// On remplit les tableaux en faisant attention aux valeurs des bouts. // Fill tables taking attention to end values.
ContactOrder.Init(0); ContactOrder.Init(0);
ContactOrder(2) = ContactOrder(num_poles - 1) = 1; ContactOrder(2) = ContactOrder(num_poles - 1) = 1;
@ -721,7 +720,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
if (Precision::IsInfinite(algtol)) { if (Precision::IsInfinite(algtol)) {
mySameParameter = Standard_False; mySameParameter = Standard_False;
#ifdef DEB #ifdef DEB
cout<<"SameParameter probleme : fonction d'interpolation du parametrage aux fraises !!"<<endl; cout<<"SameParameter problem : function of interpolation of parametration at mills !!"<<endl;
#endif #endif
return; return;
} }
@ -735,7 +734,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
#ifdef DEB #ifdef DEB
if (Voir) { if (Voir) {
if(algtol > besttol){ if(algtol > besttol){
cout<<"SameParameter : Tol non atteinte avant approx"<<endl; cout<<"SameParameter : Tol can't be reached before approx"<<endl;
} }
} }
#endif #endif
@ -760,7 +759,7 @@ void Approx_SameParameter::Build(const Standard_Real Tolerance)
else { else {
#ifdef DEB #ifdef DEB
if (Voir) if (Voir)
cout<<"SameParameter : Pas assez de points, on enrichit"<<endl; cout<<"SameParameter : Not enough points, enrich"<<endl;
#endif #endif
Standard_Integer newcount = 0; Standard_Integer newcount = 0;

View File

@ -58,7 +58,7 @@ Approx_SweepApproximation::
Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func) Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func)
{ {
myFunc = Func; myFunc = Func;
// Init des variables de controles // Init of variables of control
myParam = 0; myParam = 0;
myOrder = -1; myOrder = -1;
first = 1.e100; last = -1.e100; first = 1.e100; last = -1.e100;
@ -79,7 +79,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
Standard_Real Tol, Tol3dMin = Tol3d, The3D2DTol=0 ; Standard_Real Tol, Tol3dMin = Tol3d, The3D2DTol=0 ;
GeomAbs_Shape continuity = Continuity; GeomAbs_Shape continuity = Continuity;
// (1) Caracteristiques d'une section // (1) Characteristics of a section
myFunc->SectionShape(NbPolSect, NbKnotSect, udeg); myFunc->SectionShape(NbPolSect, NbKnotSect, udeg);
Num2DSS = myFunc->Nb2dCurves(); Num2DSS = myFunc->Nb2dCurves();
tabUKnots = new (TColStd_HArray1OfReal) (1, NbKnotSect); tabUKnots = new (TColStd_HArray1OfReal) (1, NbKnotSect);
@ -87,11 +87,11 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
myFunc->Knots(tabUKnots->ChangeArray1()); myFunc->Knots(tabUKnots->ChangeArray1());
myFunc->Mults(tabUMults->ChangeArray1()); myFunc->Mults(tabUMults->ChangeArray1());
// (2) Decompositition en sous espaces // (2) Decompositition into sub-spaces
Handle(TColStd_HArray1OfReal) OneDTol, TwoDTol, ThreeDTol; Handle(TColStd_HArray1OfReal) OneDTol, TwoDTol, ThreeDTol;
Num3DSS = NbPolSect; Num3DSS = NbPolSect;
// (2.1) Tolerance 3d et 1d // (2.1) Tolerance 3d and 1d
OneDTol = new (TColStd_HArray1OfReal) (1, Num3DSS); OneDTol = new (TColStd_HArray1OfReal) (1, Num3DSS);
ThreeDTol = new (TColStd_HArray1OfReal) (1, Num3DSS); ThreeDTol = new (TColStd_HArray1OfReal) (1, Num3DSS);
@ -110,24 +110,24 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
Translation.SetXYZ Translation.SetXYZ
(myFunc->BarycentreOfSurf().XYZ()); (myFunc->BarycentreOfSurf().XYZ());
for (ii=1; ii<=Num3DSS; ii++) { for (ii=1; ii<=Num3DSS; ii++) {
Tol = ThreeDTol->Value(ii)/2; //Afin de respecter l'erreur sur le resultat final. Tol = ThreeDTol->Value(ii)/2; // To take accout of the error on the final result.
OneDTol->SetValue(ii, Tol * Wmin(ii) / Size); OneDTol->SetValue(ii, Tol * Wmin(ii) / Size);
Tol *= Wmin(ii); //Facteur de projection Tol *= Wmin(ii); //Factor of projection
ThreeDTol->SetValue(ii, Max(Tol, 1.e-20) ); ThreeDTol->SetValue(ii, Max(Tol, 1.e-20) );
} }
} }
else { Num1DSS = 0; } else { Num1DSS = 0; }
// (2.2) Tolerance et Transformation 2d. // (2.2) Tolerance and Transformation 2d.
if (Num2DSS == 0) {TwoDTol.Nullify();} if (Num2DSS == 0) {TwoDTol.Nullify();}
else { else {
// pour le 2d on definit une affinite a partir des resolutions, afin // for 2d define affinity using resolutions, to
// d'avoir une tolerance d'approximation homogene (u/v et 2d/3d) // avoid homogenuous tolerance of approximation (u/v and 2d/3d)
Standard_Real res, tolu, tolv; Standard_Real res, tolu, tolv;
TwoDTol = new (TColStd_HArray1OfReal) (1, Num2DSS); TwoDTol = new (TColStd_HArray1OfReal) (1, Num2DSS);
AAffin = new (Approx_HArray1OfGTrsf2d) (1, Num2DSS); AAffin = new (Approx_HArray1OfGTrsf2d) (1, Num2DSS);
The3D2DTol= 0.9*BoundTol; // 10% de securite The3D2DTol= 0.9*BoundTol; // 10% of security
for (ii=1; ii<=Num2DSS; ii++) { for (ii=1; ii<=Num2DSS; ii++) {
myFunc->Resolution(ii, The3D2DTol, tolu, tolv); myFunc->Resolution(ii, The3D2DTol, tolu, tolv);
if ( tolu> tolv ) { if ( tolu> tolv ) {
@ -159,7 +159,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS); myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS); COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
} }
// Controle que myFunc->D2 est implemente // Checks if myFunc->D2 is implemented
if (continuity >= GeomAbs_C2) { if (continuity >= GeomAbs_C2) {
Standard_Boolean B; Standard_Boolean B;
B = myFunc->D2(First, First, Last, B = myFunc->D2(First, First, Last,
@ -171,7 +171,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
myD2Weigths->ChangeArray1()); myD2Weigths->ChangeArray1());
if (!B) continuity = GeomAbs_C1; if (!B) continuity = GeomAbs_C1;
} }
// Controle que myFunc->D1 est implemente // Checks if myFunc->D1 is implemented
if (continuity == GeomAbs_C1) { if (continuity == GeomAbs_C1) {
Standard_Boolean B; Standard_Boolean B;
B = myFunc->D1(First, First, Last, B = myFunc->D1(First, First, Last,
@ -181,14 +181,14 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
if (!B) continuity = GeomAbs_C0; if (!B) continuity = GeomAbs_C0;
} }
//Pour que F soit au moins 20 fois plus precise que son approx // So that F was at least 20 times more exact than its approx
myFunc->SetTolerance(Tol3dMin/20, Tol2d/20); myFunc->SetTolerance(Tol3dMin/20, Tol2d/20);
Standard_Integer NbIntervalC2 = myFunc->NbIntervals(GeomAbs_C2); Standard_Integer NbIntervalC2 = myFunc->NbIntervals(GeomAbs_C2);
Standard_Integer NbIntervalC3 = myFunc->NbIntervals(GeomAbs_C3); Standard_Integer NbIntervalC3 = myFunc->NbIntervals(GeomAbs_C3);
if (NbIntervalC3 > 1) { if (NbIntervalC3 > 1) {
// (3.1) Approximation avec decoupe preferentiel // (3.1) Approximation with preferential cut
TColStd_Array1OfReal Param_de_decoupeC2 (1, NbIntervalC2+1); TColStd_Array1OfReal Param_de_decoupeC2 (1, NbIntervalC2+1);
myFunc->Intervals(Param_de_decoupeC2, GeomAbs_C2); myFunc->Intervals(Param_de_decoupeC2, GeomAbs_C2);
TColStd_Array1OfReal Param_de_decoupeC3 (1, NbIntervalC3+1); TColStd_Array1OfReal Param_de_decoupeC3 (1, NbIntervalC3+1);
@ -208,7 +208,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
Preferentiel); Preferentiel);
} }
else { else {
// (3.2) Approximation sans decoupe preferentiel // (3.2) Approximation without preferential cut
AdvApprox_DichoCutting Dichotomie; AdvApprox_DichoCutting Dichotomie;
Approx_SweepApproximation_Eval ev (*this); Approx_SweepApproximation_Eval ev (*this);
Approximation(OneDTol, TwoDTol, ThreeDTol, Approximation(OneDTol, TwoDTol, ThreeDTol,
@ -223,7 +223,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First,
//======================================================================== //========================================================================
//function : Approximation //function : Approximation
//purpose : Appel F(t) et stocke les resultats //purpose : Call F(t) and store the results
//======================================================================== //========================================================================
void Approx_SweepApproximation:: void Approx_SweepApproximation::
Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol, Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
@ -252,14 +252,13 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
done = Approx.HasResult(); done = Approx.HasResult();
if (done) { if (done) {
// --> Remplissage des Champs de la surface ---- // --> Fill Champs of the surface ----
Standard_Integer ii, jj; Standard_Integer ii, jj;
vdeg = Approx.Degree(); vdeg = Approx.Degree();
// Malheureusement Adv_Approx stock la transpose de // Unfortunately Adv_Approx stores the transposition of the required
// ce que l'on souhaite, donc l'ecriture // so, writing tabPoles = Approx.Poles() will give an erroneous result
// tabPoles = Approx.Poles() donnerait un resultat errone // It is only possible to allocate and recopy term by term...
// Il n'y a plus qu'a allouer et recopier termes a termes...
tabPoles = new (TColgp_HArray2OfPnt) tabPoles = new (TColgp_HArray2OfPnt)
(1, Num3DSS, 1, Approx.NbPoles()); (1, Num3DSS, 1, Approx.NbPoles());
tabWeights = new (TColStd_HArray2OfReal) tabWeights = new (TColStd_HArray2OfReal)
@ -272,7 +271,7 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
for (jj=1; jj <=Approx.NbPoles() ; jj++) { for (jj=1; jj <=Approx.NbPoles() ; jj++) {
P = Approx.Poles()->Value(jj,ii); P = Approx.Poles()->Value(jj,ii);
wpoid = Approx.Poles1d()->Value(jj,ii); wpoid = Approx.Poles1d()->Value(jj,ii);
P.ChangeCoord() /= wpoid; // Il faut diviser les poles par les poids P.ChangeCoord() /= wpoid; // It is necessary to divide poles by weight
P.Translate(Translation); P.Translate(Translation);
tabPoles->SetValue (ii, jj, P); tabPoles->SetValue (ii, jj, P);
tabWeights->SetValue(ii, jj, wpoid ); tabWeights->SetValue(ii, jj, wpoid );
@ -288,13 +287,13 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
} }
} }
// ici cela va mieux // this is better
tabVKnots = Approx.Knots(); tabVKnots = Approx.Knots();
tabVMults = Approx.Multiplicities(); tabVMults = Approx.Multiplicities();
// --> Remplissage des courbes 2d ---------- // --> Filling of curves 2D ----------
if (Num2DSS>0) { if (Num2DSS>0) {
gp_GTrsf2d TrsfInv; gp_GTrsf2d TrsfInv;
deg2d = vdeg; deg2d = vdeg;
@ -306,14 +305,14 @@ Approximation(const Handle(TColStd_HArray1OfReal)& OneDTol,
Handle(TColgp_HArray1OfPnt2d) P2d = Handle(TColgp_HArray1OfPnt2d) P2d =
new (TColgp_HArray1OfPnt2d) (1, Approx.NbPoles()); new (TColgp_HArray1OfPnt2d) (1, Approx.NbPoles());
Approx.Poles2d( ii, P2d->ChangeArray1() ); Approx.Poles2d( ii, P2d->ChangeArray1() );
// On n'oublie pas d'appliquer l'homothetie inverse. // do not forget to apply inverted homothety.
for (jj=1; jj<=Approx.NbPoles(); jj++) { for (jj=1; jj<=Approx.NbPoles(); jj++) {
TrsfInv.Transforms(P2d->ChangeValue(jj).ChangeCoord()); TrsfInv.Transforms(P2d->ChangeValue(jj).ChangeCoord());
} }
seqPoles2d.Append(P2d); seqPoles2d.Append(P2d);
} }
} }
// ---> Remplissage des erreurs // ---> Filling of errors
MError3d = new (TColStd_HArray1OfReal) (1,Num3DSS); MError3d = new (TColStd_HArray1OfReal) (1,Num3DSS);
AError3d = new (TColStd_HArray1OfReal) (1,Num3DSS); AError3d = new (TColStd_HArray1OfReal) (1,Num3DSS);
for (ii=1; ii<=Num3DSS; ii++) { for (ii=1; ii<=Num3DSS; ii++) {
@ -375,21 +374,20 @@ Standard_Boolean Approx_SweepApproximation::D0(const Standard_Real Param,
Standard_Boolean Ok=Standard_True; Standard_Boolean Ok=Standard_True;
Standard_Real * LocalResult = &Result; Standard_Real * LocalResult = &Result;
// Gestion des Bornes // Management of limits
if ((first!=First) || (Last!=last)) { if ((first!=First) || (Last!=last)) {
myFunc->SetInterval(First, Last); myFunc->SetInterval(First, Last);
} }
if (! ( (Param==myParam) && (myOrder>=0) if (! ( (Param==myParam) && (myOrder>=0)
&& (first==First) && (Last==last)) ) { && (first==First) && (Last==last)) ) {
// Positionement dans le cas ou l'on ne repete pas // Positioning in case when the last operation is not repeated.
// la derniere operation
Ok = myFunc->D0(Param, First, Last, Ok = myFunc->D0(Param, First, Last,
myPoles->ChangeArray1(), myPoles->ChangeArray1(),
myPoles2d->ChangeArray1(), myPoles2d->ChangeArray1(),
myWeigths->ChangeArray1()); myWeigths->ChangeArray1());
// On multiplie les poles3d par les poids apres tranlations. // poles3d are multiplied by weight after tranlation.
for (ii=1; ii<=Num1DSS; ii++) { for (ii=1; ii<=Num1DSS; ii++) {
myPoles->ChangeValue(ii).ChangeCoord() myPoles->ChangeValue(ii).ChangeCoord()
-= Translation.XYZ(); -= Translation.XYZ();
@ -397,19 +395,19 @@ Standard_Boolean Approx_SweepApproximation::D0(const Standard_Real Param,
*= myWeigths->Value(ii); *= myWeigths->Value(ii);
} }
// On applique la transformation aux poles 2d. // The transformation is applied to poles 2d.
for (ii=1; ii<=Num2DSS; ii++) { for (ii=1; ii<=Num2DSS; ii++) {
AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord()); AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord());
} }
// Mise a jour des variable de controles et retour // Update variables of controle and return
first = First; first = First;
last = Last; last = Last;
myOrder = 0; myOrder = 0;
myParam = Param; myParam = Param;
} }
// Extraction des resultats // Extraction of results
index = 0; index = 0;
for (ii=1; ii<=Num1DSS; ii++) { for (ii=1; ii<=Num1DSS; ii++) {
LocalResult[index] = myWeigths->Value(ii); LocalResult[index] = myWeigths->Value(ii);
@ -448,7 +446,7 @@ Standard_Boolean Approx_SweepApproximation::D1(const Standard_Real Param,
if (! ( (Param==myParam) && (myOrder>=1) if (! ( (Param==myParam) && (myOrder>=1)
&& (first==First) && (Last==last)) ){ && (first==First) && (Last==last)) ){
// Positionement // Positioning
Ok = myFunc->D1(Param, First, Last, Ok = myFunc->D1(Param, First, Last,
myPoles->ChangeArray1(), myPoles->ChangeArray1(),
myDPoles->ChangeArray1(), myDPoles->ChangeArray1(),
@ -457,22 +455,22 @@ Standard_Boolean Approx_SweepApproximation::D1(const Standard_Real Param,
myWeigths->ChangeArray1(), myWeigths->ChangeArray1(),
myDWeigths->ChangeArray1()); myDWeigths->ChangeArray1());
// On tient compte de la multiplication des poles3d par les poids. // Take into account the multiplication of poles3d by weights.
// et de la translation. // and the translation.
for ( ii=1; ii<=Num1DSS; ii++) { for ( ii=1; ii<=Num1DSS; ii++) {
//Translation sur la section //Translation on the section
myPoles->ChangeValue(ii).ChangeCoord() myPoles->ChangeValue(ii).ChangeCoord()
-= Translation.XYZ(); -= Translation.XYZ();
// Homothetie sur tout // Homothety on all.
myDPoles->ChangeValue(ii) *= myWeigths->Value(ii); myDPoles->ChangeValue(ii) *= myWeigths->Value(ii);
Vaux.SetXYZ( myPoles->Value(ii).Coord()); Vaux.SetXYZ( myPoles->Value(ii).Coord());
myDPoles->ChangeValue(ii) += myDWeigths->Value(ii)*Vaux; myDPoles->ChangeValue(ii) += myDWeigths->Value(ii)*Vaux;
myPoles->ChangeValue(ii).ChangeCoord() myPoles->ChangeValue(ii).ChangeCoord()
*= myWeigths->Value(ii); // Pour le cache *= myWeigths->Value(ii); // for the cash
} }
// On applique les transformation 2d aux vecteurs idoines // Apply transformation 2d to suitable vectors
for (ii=1; ii<=Num2DSS; ii++) { for (ii=1; ii<=Num2DSS; ii++) {
Vcoord = myDPoles2d->Value(ii).XY(); Vcoord = myDPoles2d->Value(ii).XY();
AAffin->Value(ii).Transforms(Vcoord); AAffin->Value(ii).Transforms(Vcoord);
@ -480,14 +478,14 @@ Standard_Boolean Approx_SweepApproximation::D1(const Standard_Real Param,
AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord()); AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord());
} }
// Mise a jour des variable de controles et retour // Update control variables and return
first = First; first = First;
last = Last; last = Last;
myOrder = 1; myOrder = 1;
myParam = Param; myParam = Param;
} }
// Extraction des resultats // Extraction of results
index = 0; index = 0;
for (ii=1; ii<=Num1DSS; ii++) { for (ii=1; ii<=Num1DSS; ii++) {
LocalResult[index] = myDWeigths->Value(ii); LocalResult[index] = myDWeigths->Value(ii);
@ -517,15 +515,14 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param,
Standard_Boolean Ok=Standard_True; Standard_Boolean Ok=Standard_True;
Standard_Real * LocalResult = &Result; Standard_Real * LocalResult = &Result;
// Gestion des Bornes // management of limits
if ((first!=First) || (Last!=last)) { if ((first!=First) || (Last!=last)) {
myFunc->SetInterval(First, Last); myFunc->SetInterval(First, Last);
} }
if (! ( (Param==myParam) && (myOrder>=2) if (! ( (Param==myParam) && (myOrder>=2)
&& (first==First) && (Last==last)) ) { && (first==First) && (Last==last)) ) {
// Positionement dans le cas ou l'on ne repete pas // Positioning in case when the last operation is not repeated
// la derniere operation
Ok = myFunc->D2(Param, First, Last, Ok = myFunc->D2(Param, First, Last,
myPoles->ChangeArray1(), myPoles->ChangeArray1(),
myDPoles->ChangeArray1(), myDPoles->ChangeArray1(),
@ -537,20 +534,20 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param,
myDWeigths->ChangeArray1(), myDWeigths->ChangeArray1(),
myD2Weigths->ChangeArray1()); myD2Weigths->ChangeArray1());
// On multiplie les poles3d par les poids apres tranlations. // Multiply poles3d by the weight after tranlations.
for (ii=1; ii<=Num1DSS; ii++) { for (ii=1; ii<=Num1DSS; ii++) {
// D'abord on translate // First translate
myPoles->ChangeValue(ii).ChangeCoord() myPoles->ChangeValue(ii).ChangeCoord()
-= Translation.XYZ(); -= Translation.XYZ();
//On calcul la derive seconde //Calculate the second derivative
myD2Poles->ChangeValue(ii) *= myWeigths->Value(ii); myD2Poles->ChangeValue(ii) *= myWeigths->Value(ii);
Vaux.SetXYZ( myDPoles->Value(ii).XYZ()); Vaux.SetXYZ( myDPoles->Value(ii).XYZ());
myD2Poles->ChangeValue(ii) += (2*myDWeigths->Value(ii))*Vaux; myD2Poles->ChangeValue(ii) += (2*myDWeigths->Value(ii))*Vaux;
Vaux.SetXYZ( myPoles->Value(ii).Coord()); Vaux.SetXYZ( myPoles->Value(ii).Coord());
myD2Poles->ChangeValue(ii) += myD2Weigths->Value(ii)*Vaux; myD2Poles->ChangeValue(ii) += myD2Weigths->Value(ii)*Vaux;
//Puis le reste pour le cache //Then the remainder for the cash
myDPoles->ChangeValue(ii) *= myWeigths->Value(ii); myDPoles->ChangeValue(ii) *= myWeigths->Value(ii);
Vaux.SetXYZ( myPoles->Value(ii).Coord()); Vaux.SetXYZ( myPoles->Value(ii).Coord());
myDPoles->ChangeValue(ii) += myDWeigths->Value(ii)*Vaux; myDPoles->ChangeValue(ii) += myDWeigths->Value(ii)*Vaux;
@ -558,7 +555,7 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param,
*= myWeigths->Value(ii); *= myWeigths->Value(ii);
} }
// On applique la transformation aux poles 2d. // Apply transformation to poles 2d.
for (ii=1; ii<=Num2DSS; ii++) { for (ii=1; ii<=Num2DSS; ii++) {
Vcoord = myD2Poles2d->Value(ii).XY(); Vcoord = myD2Poles2d->Value(ii).XY();
AAffin->Value(ii).Transforms(Vcoord); AAffin->Value(ii).Transforms(Vcoord);
@ -569,14 +566,14 @@ Standard_Boolean Approx_SweepApproximation::D2(const Standard_Real Param,
AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord()); AAffin->Value(ii).Transforms(myPoles2d->ChangeValue(ii).ChangeCoord());
} }
// Mise a jour des variable de controles et retour // Update variables of control and return
first = First; first = First;
last = Last; last = Last;
myOrder = 2; myOrder = 2;
myParam = Param; myParam = Param;
} }
// Extraction des resultats // Extraction of results
index = 0; index = 0;
for (ii=1; ii<=Num1DSS; ii++) { for (ii=1; ii<=Num1DSS; ii++) {
LocalResult[index] = myD2Weigths->Value(ii); LocalResult[index] = myD2Weigths->Value(ii);

View File

@ -8,13 +8,13 @@
//-Version //-Version
//-Design Declaration des variables specifiques au contexte //-Design Declaration of variables specific to the context
// de trace des facettes // of tracing facets
//-Warning Un contexte de trace de facette est defini par : //-Warning Context of tracing facets id defined by:
// - le style de l'interieur de la facette // - the style of the interior of the facet
// - le style du bord de la facette // - the style of the border of the facet
// - la couleur // - the color
//-References //-References
@ -29,16 +29,16 @@
//-Global data definitions //-Global data definitions
// -- l'interieur // -- interior
// MyInteriorStyle : InteriorStyle; // MyInteriorStyle : InteriorStyle;
// MyInteriorColor : Color; // MyInteriorColor : Color;
// -- le bord // -- border
// MyEdgeColor : Color; // MyEdgeColor : Color;
// MyEdgeType : TypeOfLine; // MyEdgeType : TypeOfLine;
// MyEdgeWidth : Standard_Real; // MyEdgeWidth : Standard_Real;
// -- les hachures // -- shading
// MyHatchStyle : HatchStyle; // MyHatchStyle : HatchStyle;

View File

@ -7,13 +7,13 @@
//-Version //-Version
//-Design Declaration des variables specifiques au contexte //-Design Declaration of variables specific to the context
// de trace de lignes // of line tracing
//-Warning Un contexte de trace de ligne est defini par : //-Warning A context of line tracing is defined by :
// - la couleur // - the color
// - le type de trait // - the type of line
// - l'epaisseur // - the thickness
//-References //-References
@ -28,13 +28,13 @@
//-Global data definitions //-Global data definitions
// -- la couleur // -- color
// MyColor : Color; // MyColor : Color;
// -- le type de trait // -- type of line
// MyType : TypeOfLine; // MyType : TypeOfLine;
// -- l'epaisseur // -- thickness
// MyWidth : Standard_Real; // MyWidth : Standard_Real;
//-Constructors //-Constructors

View File

@ -7,13 +7,13 @@
//-Version //-Version
//-Design Declaration des variables specifiques au contexte //-Design Declaration of variables specific to the context
// de trace de markers // of tracing of markers
//-Warning Un contexte de trace de marker est defini par : //-Warning Context of tracing of markers is defined by :
// - la couleur // - the color
// - le type // - the type
// - l'echelle // - the scale
//-References //-References
@ -28,13 +28,13 @@
//-Global data definitions //-Global data definitions
// -- la couleur // -- color
// MyColor : Color; // MyColor : Color;
// -- le type // -- type
// MyType : TypeOfMarker; // MyType : TypeOfMarker;
// -- l'echelle // -- scale
// MyScale : Standard_Real; // MyScale : Standard_Real;
//-Constructors //-Constructors

View File

@ -1,10 +1,10 @@
/*********************************************************************** /***********************************************************************
FONCTION : FUNCTION :
---------- ----------
Classe Aspect_Driver : Class Aspect_Driver :
HISTORIQUE DES MODIFICATIONS : HISTORY OF MODIFICATIONS :
-------------------------------- --------------------------------
14-05-98 : GG ; Disable using MFT when the symbol 14-05-98 : GG ; Disable using MFT when the symbol
@ -12,13 +12,13 @@
See dirMFTisDefined changes. See dirMFTisDefined changes.
30-01-98 : GG ; SPEC_MFT 30-01-98 : GG ; SPEC_MFT
L'utilisation des polices MFT devient parametrable. Use of polices MFT becomes parameterized.
Le driver doit utiliser la methode UseMFT() pour The driver should use method UseMFT() to
savoir s'il doit utiliser ou non les polices know if it is necessary or not to use MDTV policies
MDTV a la place des polices system. instead of system policies.
-> Modifications dans SetFontMap() -> Modifications in SetFontMap()
-> Nouvelle methode UseMFT() -> New method UseMFT()
***********************************************************************/ ***********************************************************************/

View File

@ -314,7 +314,7 @@ Handle(Geom2d_Curve) BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
TopLoc_Location LC; TopLoc_Location LC;
Standard_Real f, l;// pour les malins qui appellent avec (u,u). Standard_Real f, l;// for those who call with (u,u).
Handle(Geom_Curve) C3d = Handle(Geom_Curve) C3d =
BRep_Tool::Curve(E,/*LC,*/f,l); // transforming plane instead of curve BRep_Tool::Curve(E,/*LC,*/f,l); // transforming plane instead of curve
// we can loose scale factor of Curve transformation (eap 13 May 2002) // we can loose scale factor of Curve transformation (eap 13 May 2002)
@ -418,9 +418,9 @@ void BRep_Tool::CurveOnSurface(const TopoDS_Edge& E,
if (i > Index) break; if (i > Index) break;
if (i == Index) { if (i == Index) {
// JMB le 21 Mai 1999 // JMB le 21 Mai 1999
// on fait comme dans les autres methodes CurveOnSurface. c.a.d on tient // it is done as in the other CurveOnSurface methods, ie. take into account
// compte de l'orientation dans le cas des aretes de coutures (renvoi de PCurve2) // the orientation in case of cut edges (return PCurve2)
// sinon on risque de louper des curves ou de ne pas obtenir la bonne. // otherwise there is a risk to loop curves or to not get the prover one.
if (GC->IsCurveOnClosedSurface() && Eisreversed) if (GC->IsCurveOnClosedSurface() && Eisreversed)
C = GC->PCurve2(); C = GC->PCurve2();
else else
@ -1372,7 +1372,7 @@ gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V,
L = L.Predivided(V.Location()); L = L.Predivided(V.Location());
BRep_ListIteratorOfListOfPointRepresentation itpr BRep_ListIteratorOfListOfPointRepresentation itpr
((*((Handle(BRep_TVertex)*) &V.TShape()))->Points()); ((*((Handle(BRep_TVertex)*) &V.TShape()))->Points());
// On regarde dabord si il y des PointRepresentation (cas non Manifold) // It is checked if there is PointRepresentation (case non Manifold)
while (itpr.More()) { while (itpr.More()) {
if (itpr.Value()->IsPointOnSurface(S,L)) { if (itpr.Value()->IsPointOnSurface(S,L)) {
@ -1384,8 +1384,8 @@ gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V,
TopoDS_Vertex Vf,Vl; TopoDS_Vertex Vf,Vl;
TopoDS_Edge E; TopoDS_Edge E;
// Sinon on explore les aretes (PMN 4/06/97) On ne peut pas faire un raise 999/1000! // Otherwise the edges are searched (PMN 4/06/97) It is not possible to succeed 999/1000!
// meme si souvent il y a moyen de faire plus economique au dessus... // even if often there is a way to make more economically than above...
TopExp_Explorer exp; TopExp_Explorer exp;
for (exp.Init(F, TopAbs_EDGE); exp.More(); exp.Next()) { for (exp.Init(F, TopAbs_EDGE); exp.More(); exp.Next()) {
E = TopoDS::Edge(exp.Current()); E = TopoDS::Edge(exp.Current());
@ -1394,7 +1394,7 @@ gp_Pnt2d BRep_Tool::Parameters(const TopoDS_Vertex& V,
gp_Pnt2d Pf, Pl; gp_Pnt2d Pf, Pl;
UVPoints(E, F, Pf, Pl); UVPoints(E, F, Pf, Pl);
if (V.IsSame(Vf)) return Pf; if (V.IsSame(Vf)) return Pf;
else return Pl;//Ambiguite (naturelle) pour les edges degenerees. else return Pl;//Ambiguity (natural) for degenerated edges.
} }
} }
Standard_NoSuchObject::Raise("BRep_Tool:: no parameters on surface"); Standard_NoSuchObject::Raise("BRep_Tool:: no parameters on surface");

View File

@ -73,8 +73,7 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
} }
} }
Forward = Standard_True; // Defaut ; Les Edge Reverse seront parcourue Forward = Standard_True; // Defaut ; The Reverse Edges are parsed.
// a rebourt.
if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) { if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation(); TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
Standard_Boolean B; Standard_Boolean B;
@ -83,11 +82,11 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
myCurves->Value(2).Edge(), myCurves->Value(2).Edge(),
VI); VI);
VL = TopExp::LastVertex(myCurves->Value(1).Edge()); VL = TopExp::LastVertex(myCurves->Value(1).Edge());
if (VI.IsSame(VL)) { // On Garde toujours le sens de parcout if (VI.IsSame(VL)) { // The direction of parsing is always preserved
if (Or == TopAbs_REVERSED) if (Or == TopAbs_REVERSED)
Forward = Standard_False; Forward = Standard_False;
} }
else {// On renverse toujours le sens de parcout else {// The direction of parsing is always reversed
if (Or != TopAbs_REVERSED) if (Or != TopAbs_REVERSED)
Forward = Standard_False; Forward = Standard_False;
} }
@ -115,14 +114,14 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
TLast = Last; TLast = Last;
PTol = Tol; PTol = Tol;
// Trim des courbes extremes. // Trim the extremal curves.
Handle (BRepAdaptor_HCurve) HC; Handle (BRepAdaptor_HCurve) HC;
Standard_Integer i1, i2; Standard_Integer i1, i2;
Standard_Real f=TFirst, l=TLast, d; Standard_Real f=TFirst, l=TLast, d;
i1 = i2 = CurIndex; i1 = i2 = CurIndex;
Prepare(f, d, i1); Prepare(f, d, i1);
Prepare(l, d, i2); Prepare(l, d, i2);
CurIndex = (i1+i2)/2; // Petite optimisation CurIndex = (i1+i2)/2; // Small optimization
if (i1==i2) { if (i1==i2) {
if (l > f) if (l > f)
HC = Handle(BRepAdaptor_HCurve)::DownCast(myCurves->Value(i1).Trim(f, l, PTol)); HC = Handle(BRepAdaptor_HCurve)::DownCast(myCurves->Value(i1).Trim(f, l, PTol));
@ -207,14 +206,14 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
Standard_Integer ii, jj, kk, n; Standard_Integer ii, jj, kk, n;
Standard_Real f, F, delta; Standard_Real f, F, delta;
// Premiere courbe (sens de parcourt de le edge) // First curve (direction of parsing of the edge)
n = myCurves->ChangeValue(1).NbIntervals(S); n = myCurves->ChangeValue(1).NbIntervals(S);
Handle(TColStd_HArray1OfReal) Ti = new (TColStd_HArray1OfReal) (1, n+1); Handle(TColStd_HArray1OfReal) Ti = new (TColStd_HArray1OfReal) (1, n+1);
myCurves->ChangeValue(1).Intervals(Ti->ChangeArray1(), S); myCurves->ChangeValue(1).Intervals(Ti->ChangeArray1(), S);
InvPrepare(1, f, delta); InvPrepare(1, f, delta);
F = myKnots->Value(1); F = myKnots->Value(1);
if (delta < 0) { if (delta < 0) {
//sens de parcourt inverser // invert the direction of parsing
for (kk=1,jj=Ti->Length(); jj>0; kk++, jj--) for (kk=1,jj=Ti->Length(); jj>0; kk++, jj--)
T(kk) = F + (Ti->Value(jj)-f)*delta; T(kk) = F + (Ti->Value(jj)-f)*delta;
} }
@ -223,7 +222,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
T(kk) = F + (Ti->Value(kk)-f)*delta; T(kk) = F + (Ti->Value(kk)-f)*delta;
} }
// et les suivante // and the next
for (ii=2; ii<=myCurves->Length(); ii++) { for (ii=2; ii<=myCurves->Length(); ii++) {
n = myCurves->ChangeValue(ii).NbIntervals(S); n = myCurves->ChangeValue(ii).NbIntervals(S);
if (n != Ti->Length()-1) Ti = new (TColStd_HArray1OfReal) (1, n+1); if (n != Ti->Length()-1) Ti = new (TColStd_HArray1OfReal) (1, n+1);
@ -231,7 +230,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
InvPrepare(ii, f, delta); InvPrepare(ii, f, delta);
F = myKnots->Value(ii); F = myKnots->Value(ii);
if (delta < 0) { if (delta < 0) {
//sens de parcourt inverser // invert the direction of parcing
for (jj=Ti->Length()-1; jj>0; kk++, jj--) for (jj=Ti->Length()-1; jj>0; kk++, jj--)
T(kk) = F + (Ti->Value(jj)-f)*delta; T(kk) = F + (Ti->Value(jj)-f)*delta;
} }
@ -346,7 +345,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
GeomAbs_CurveType BRepAdaptor_CompCurve::GetType() const GeomAbs_CurveType BRepAdaptor_CompCurve::GetType() const
{ {
return GeomAbs_OtherCurve; //temporaire return GeomAbs_OtherCurve; //temporary
// if ( myCurves->Length() > 1) return GeomAbs_OtherCurve; // if ( myCurves->Length() > 1) return GeomAbs_OtherCurve;
// return myCurves->Value(1).GetType(); // return myCurves->Value(1).GetType();
} }
@ -409,10 +408,10 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
//======================================================================= //=======================================================================
//function : Prepare //function : Prepare
//purpose : //purpose :
// Lorsque le parametre est pres de un "noeud" on determine la loi en // When the parameter is close to "node" the rule is determined
// fonction du signe de tol: // depending on the sign of tol:
// - negatif -> Loi precedente au noeud. // - negative -> Rule preceding to the node.
// - positif -> Loi consecutive au noeud. // - positive -> Rule following after the node.
//======================================================================= //=======================================================================
void BRepAdaptor_CompCurve::Prepare(Standard_Real& W, void BRepAdaptor_CompCurve::Prepare(Standard_Real& W,
@ -425,7 +424,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
else { Eps = -PTol;} else { Eps = -PTol;}
Wtest = W+Eps; //Decalage pour discriminer les noeuds Wtest = W+Eps; //Offset to discriminate the nodes
if(Periodic){ if(Periodic){
Wtest = ElCLib::InPeriod(Wtest, Wtest = ElCLib::InPeriod(Wtest,
0, 0,
@ -433,7 +432,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
W = Wtest-Eps; W = Wtest-Eps;
} }
// Recheche de le index // Find the index
Standard_Boolean Trouve = Standard_False; Standard_Boolean Trouve = Standard_False;
if (myKnots->Value(CurIndex) > Wtest) { if (myKnots->Value(CurIndex) > Wtest) {
for (ii=CurIndex-1; ii>0 && !Trouve; ii--) for (ii=CurIndex-1; ii>0 && !Trouve; ii--)
@ -441,7 +440,7 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
CurIndex = ii; CurIndex = ii;
Trouve = Standard_True; Trouve = Standard_True;
} }
if (!Trouve) CurIndex = 1; // En dehors des bornes ... if (!Trouve) CurIndex = 1; // Out of limits...
} }
else if (myKnots->Value(CurIndex+1) <= Wtest) { else if (myKnots->Value(CurIndex+1) <= Wtest) {
@ -450,17 +449,17 @@ const TopoDS_Wire& BRepAdaptor_CompCurve::Wire() const
CurIndex = ii; CurIndex = ii;
Trouve = Standard_True; Trouve = Standard_True;
} }
if (!Trouve) CurIndex = myCurves->Length(); // En dehors des bornes ... if (!Trouve) CurIndex = myCurves->Length(); // Out of limits...
} }
// Reverse ? // Invert ?
const TopoDS_Edge& E = myCurves->Value(CurIndex).Edge(); const TopoDS_Edge& E = myCurves->Value(CurIndex).Edge();
TopAbs_Orientation Or = E.Orientation(); TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse; Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) || Reverse = (Forward && (Or == TopAbs_REVERSED)) ||
(!Forward && (Or != TopAbs_REVERSED)); (!Forward && (Or != TopAbs_REVERSED));
// Calcul du parametre local // Calculate the local parameter
BRep_Tool::Range(E, f, l); BRep_Tool::Range(E, f, l);
Delta = myKnots->Value(CurIndex+1) - myKnots->Value(CurIndex); Delta = myKnots->Value(CurIndex+1) - myKnots->Value(CurIndex);
if (Delta > PTol*1.e-9) Delta = (l-f)/Delta; if (Delta > PTol*1.e-9) Delta = (l-f)/Delta;
@ -478,15 +477,15 @@ void BRepAdaptor_CompCurve::InvPrepare(const Standard_Integer index,
Standard_Real& First, Standard_Real& First,
Standard_Real& Delta) const Standard_Real& Delta) const
{ {
// Reverse ? // Invert?
const TopoDS_Edge& E = myCurves->Value(index).Edge(); const TopoDS_Edge& E = myCurves->Value(index).Edge();
TopAbs_Orientation Or = E.Orientation(); TopAbs_Orientation Or = E.Orientation();
Standard_Boolean Reverse; Standard_Boolean Reverse;
Reverse = (Forward && (Or == TopAbs_REVERSED)) || Reverse = (Forward && (Or == TopAbs_REVERSED)) ||
(!Forward && (Or != TopAbs_REVERSED)); (!Forward && (Or != TopAbs_REVERSED));
// Calcul des parametres de reparametrisation // Calculate the parameters of reparametrisation
// tel que : T = Ti + (t-First)*Delta // such as : T = Ti + (t-First)*Delta
Standard_Real f, l; Standard_Real f, l;
BRep_Tool::Range(E, f, l); BRep_Tool::Range(E, f, l);
Delta = myKnots->Value(index+1) - myKnots->Value(index); Delta = myKnots->Value(index+1) - myKnots->Value(index);

View File

@ -86,14 +86,14 @@
BRepCheck_Analyzer ana(toCheck, Standard_True); BRepCheck_Analyzer ana(toCheck, Standard_True);
if (!ana.IsValid()) { if (!ana.IsValid()) {
// On verifie que le probleme ne soit pas juste BRepCheck_InvalidSameParameterFlag // Check if the problem is not just BRepCheck_InvalidSameParameterFlag
BRepCheck_ListIteratorOfListOfStatus itl; BRepCheck_ListIteratorOfListOfStatus itl;
BRepCheck_Status sta; BRepCheck_Status sta;
for (tEx.Init(toCheck, TopAbs_FACE); tEx.More(); tEx.Next()) { for (tEx.Init(toCheck, TopAbs_FACE); tEx.More(); tEx.Next()) {
if (!ana.Result(tEx.Current()).IsNull()) { if (!ana.Result(tEx.Current()).IsNull()) {
for (itl.Initialize(ana.Result(tEx.Current())->Status()); itl.More(); itl.Next()) { for (itl.Initialize(ana.Result(tEx.Current())->Status()); itl.More(); itl.Next()) {
sta=itl.Value(); sta=itl.Value();
// Si une face est en erreur // If a face is incorrect
if (sta != BRepCheck_NoError) { if (sta != BRepCheck_NoError) {
BRepCheck_ListIteratorOfListOfStatus ilt; BRepCheck_ListIteratorOfListOfStatus ilt;
TopExp_Explorer exp; TopExp_Explorer exp;
@ -103,7 +103,7 @@
if (res->ContextualShape().IsSame(tEx.Current())) { if (res->ContextualShape().IsSame(tEx.Current())) {
for (ilt.Initialize(res->StatusOnShape()); ilt.More(); ilt.Next()) { for (ilt.Initialize(res->StatusOnShape()); ilt.More(); ilt.Next()) {
sta=ilt.Value(); sta=ilt.Value();
// Si une edge est BRepCheck_InvalidSameParameterFlag ou BRepCheck_InvalidSameRangeFlag on force // If an edge is BRepCheck_InvalidSameParameterFlag or BRepCheck_InvalidSameRangeFlag, it is forced
if (sta == BRepCheck_InvalidSameParameterFlag || if (sta == BRepCheck_InvalidSameParameterFlag ||
sta == BRepCheck_InvalidSameRangeFlag) { sta == BRepCheck_InvalidSameRangeFlag) {
bB.SameRange(TopoDS::Edge(exp.Current()), Standard_False); bB.SameRange(TopoDS::Edge(exp.Current()), Standard_False);
@ -121,7 +121,7 @@
} }
} }
} }
// On refait un controle (il pourrait y avoir un probleme d'un autre type ou non rectifiable. // Remake control (there can be a problem of another type orb the one that cannot be corrected
ana.Init(toCheck, Standard_True); ana.Init(toCheck, Standard_True);
if (!ana.IsValid()) return Standard_False; if (!ana.IsValid()) return Standard_False;
} }
@ -151,10 +151,6 @@
{ {
// //
// pour permettre a Moliner de travailler jusqu'au 18/10/96 le temps que
// l'on trouve une solution reflechie au probleme de performance de BRepCheck
//
//POP ON n'utilise plus la varaible d'environnement
// if (getenv("DONT_SWITCH_IS_VALID") != NULL) { // if (getenv("DONT_SWITCH_IS_VALID") != NULL) {
// return Standard_True ; // return Standard_True ;
// } // }

View File

@ -21,7 +21,7 @@
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepClass3d_SolidClassifier.hxx> #include <BRepClass3d_SolidClassifier.hxx>
// couture // sewing
#include <BRepTools_Substitution.hxx> #include <BRepTools_Substitution.hxx>
#include <BRepBuilderAPI_Sewing.hxx> #include <BRepBuilderAPI_Sewing.hxx>
#include <BRepCheck.hxx> #include <BRepCheck.hxx>
@ -127,8 +127,8 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
} }
DSFiller.Insert(myS1,myS2,HDS); DSFiller.Insert(myS1,myS2,HDS);
// 020499 : JYL : rejet si il existe une arete de la SD // 020499 : JYL : reject if there is an edge of the SD
// codee non sameparameter et non degeneree // not coded sameparameter and not degenerated
Standard_Boolean esp = HDS->EdgesSameParameter(); Standard_Boolean esp = HDS->EdgesSameParameter();
Standard_Boolean tede = Standard_True; Standard_Boolean tede = Standard_True;
if (!esp) { if (!esp) {
@ -204,10 +204,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
#if MODIF #if MODIF
//====================================================================== //======================================================================
//== Exploration des shapes en entree //== Exploration of input shapes
//== Creation de la liste des solides //== Creation of the list of solids
//== Creation de la liste des faces HORS solide //== Creation of the list of faces OUT OF solid
//== Creation de la liste des edges HORS face //== Creation of the list of edges OUT OF face
Standard_Integer nbs1,nbs2,nbf1,nbf2,nbe1,nbe2,nbv1,nbv2; Standard_Integer nbs1,nbs2,nbf1,nbf2,nbe1,nbe2,nbv1,nbv2;
TopTools_ListOfShape Solids1,Solids2,Faces1,Faces2,Edges1,Edges2,Vertex1,Vertex2; TopTools_ListOfShape Solids1,Solids2,Faces1,Faces2,Edges1,Edges2,Vertex1,Vertex2;
@ -218,21 +218,21 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
for(Ex.Init(myS2,TopAbs_SOLID),nbs2=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS2,TopAbs_SOLID),nbs2=0; Ex.More(); Ex.Next()) {
Solids2.Append(Ex.Current()); nbs2++; Solids2.Append(Ex.Current()); nbs2++;
} }
//== Les faces non ds un solide //== Faces not in a solid
for(Ex.Init(myS1,TopAbs_FACE,TopAbs_SOLID),nbf1=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS1,TopAbs_FACE,TopAbs_SOLID),nbf1=0; Ex.More(); Ex.Next()) {
Faces1.Append(Ex.Current()); nbf1++; Faces1.Append(Ex.Current()); nbf1++;
} }
for(Ex.Init(myS2,TopAbs_FACE,TopAbs_SOLID),nbf2=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS2,TopAbs_FACE,TopAbs_SOLID),nbf2=0; Ex.More(); Ex.Next()) {
Faces2.Append(Ex.Current()); nbf2++; Faces2.Append(Ex.Current()); nbf2++;
} }
//== Les Edges non ds un solide //== Edges not in a solid
for(Ex.Init(myS1,TopAbs_EDGE,TopAbs_FACE),nbe1=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS1,TopAbs_EDGE,TopAbs_FACE),nbe1=0; Ex.More(); Ex.Next()) {
Edges1.Append(Ex.Current()); nbe1++; Edges1.Append(Ex.Current()); nbe1++;
} }
for(Ex.Init(myS2,TopAbs_EDGE,TopAbs_FACE),nbe2=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS2,TopAbs_EDGE,TopAbs_FACE),nbe2=0; Ex.More(); Ex.Next()) {
Edges2.Append(Ex.Current()); nbe2++; Edges2.Append(Ex.Current()); nbe2++;
} }
//== Les Vertex non ds un edge //== Vertices not in an edge
for(Ex.Init(myS1,TopAbs_VERTEX,TopAbs_EDGE),nbv1=0; Ex.More(); Ex.Next()) { for(Ex.Init(myS1,TopAbs_VERTEX,TopAbs_EDGE),nbv1=0; Ex.More(); Ex.Next()) {
Vertex1.Append(Ex.Current()); nbv1++; Vertex1.Append(Ex.Current()); nbv1++;
} }
@ -245,10 +245,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
//== //==
//== Rejet des orerations sans sens //== Reject operations without direction
//-- Coupe Solide par Edge //-- Cut Solid by Edge
// Standard_Boolean Correct = Standard_True; // Standard_Boolean Correct = Standard_True;
if( (nbs1 && nbs2==0 && St1==TopAbs_OUT && St2==TopAbs_IN) if( (nbs1 && nbs2==0 && St1==TopAbs_OUT && St2==TopAbs_IN)
|| (nbs2 && nbs1==0 && St2==TopAbs_OUT && St1==TopAbs_IN)) { || (nbs2 && nbs1==0 && St2==TopAbs_OUT && St1==TopAbs_IN)) {
@ -302,10 +302,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape); Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} // nbf1 } // nbf1
@ -326,10 +326,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape); Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} // nbf2 } // nbf2
@ -371,10 +371,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape); Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} }
@ -411,10 +411,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape); Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} }
@ -440,10 +440,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape); Sub_Classify(Ex,St1,Solids2,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} }
@ -465,16 +465,16 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
BB.Add(myShape,LV); BB.Add(myShape,LV);
} }
else { else {
//-- On classifie : //-- Classify :
Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape); Sub_Classify(Ex,St2,Solids1,BB,LIter,myShape);
} }
//-- Fin Classification //-- End Classification
} }
} }
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
//-- V1:Vertex1 state1 = OUT -> On garde V1 si V1 est Out Tous les S2 //-- V1:Vertex1 state1 = OUT -> Preserve V1 if V1 is Out all S2
//-- V1:Vertex1 state1 = IN -> On garde V1 si V1 est In un des S2 //-- V1:Vertex1 state1 = IN -> Preserve V1 if V1 is In one of S2
if(nbv1 && nbs2) { if(nbv1 && nbs2) {
if(St1 == TopAbs_IN) { if(St1 == TopAbs_IN) {
for(LIter.Initialize(Vertex1);LIter.More();LIter.Next()) { for(LIter.Initialize(Vertex1);LIter.More();LIter.Next()) {
@ -610,10 +610,10 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
TopExp_Explorer ex; TopExp_Explorer ex;
ex.Init(myShape,TopAbs_FACE); ex.Init(myShape,TopAbs_FACE);
for (; ex.More(); ex.Next()) myMap.Add(ex.Current()); for (; ex.More(); ex.Next()) myMap.Add(ex.Current());
ex.Init(myShape,TopAbs_EDGE); // pour le FRIKO ex.Init(myShape,TopAbs_EDGE); // for FRIKO
for (; ex.More(); ex.Next()) myMap.Add(ex.Current()); for (; ex.More(); ex.Next()) myMap.Add(ex.Current());
// Verification same parameter des nouvelles edges de section // Checking same parameter of new edges of section
Standard_Real eTol,cTol; Standard_Real eTol,cTol;
for (myHBuilder->InitSection(1); for (myHBuilder->InitSection(1);
myHBuilder->MoreSection(); myHBuilder->MoreSection();
@ -628,8 +628,8 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
for (ex.Init(cur, TopAbs_VERTEX); ex.More(); ex.Next()) { for (ex.Init(cur, TopAbs_VERTEX); ex.More(); ex.Next()) {
eTol = BRep_Tool::Tolerance(TopoDS::Vertex(ex.Current())); eTol = BRep_Tool::Tolerance(TopoDS::Vertex(ex.Current()));
if (eTol<cTol) { if (eTol<cTol) {
// Update ne peut que augmenter la tolerance, donc si le vertex a // Update can only increase tolerance, so if the vertex
// une tolerance + grande que ses edges on y touche pas // has a greater tolerance thanits edges it is not touched
BB.UpdateVertex(TopoDS::Vertex(ex.Current()), cTol); BB.UpdateVertex(TopoDS::Vertex(ex.Current()), cTol);
} }
} }
@ -654,7 +654,7 @@ Standard_IMPORT void FDSSDM_Close();// see TopOpeBRepDS_samdom.cxx
for (ex1.Init(myShape, TopAbs_SHELL); ex1.More(); ex1.Next()) { for (ex1.Init(myShape, TopAbs_SHELL); ex1.More(); ex1.Next()) {
BRepCheck_Shell bcs(TopoDS::Shell(ex1.Current())); BRepCheck_Shell bcs(TopoDS::Shell(ex1.Current()));
if (bcs.Closed()==BRepCheck_NotClosed) { if (bcs.Closed()==BRepCheck_NotClosed) {
// il faut les ajouter face par face pour avoir linfo IsModified sur les faces // it is required to add them face by face to avoid IsModified on faces
BRepBuilderAPI_Sewing brts; BRepBuilderAPI_Sewing brts;
for (ex3.Init(ex1.Current(), TopAbs_FACE); ex3.More(); ex3.Next()) { for (ex3.Init(ex1.Current(), TopAbs_FACE); ex3.More(); ex3.Next()) {
brts.Add(ex3.Current()); brts.Add(ex3.Current());
@ -815,7 +815,7 @@ void Sub_Classify(TopExp_Explorer& Ex,
//======================================================================= //=======================================================================
//function : InitParameters //function : InitParameters
//purpose : Info sur la geometrie : PCurve, Approx, ... //purpose : Info on geometry : PCurve, Approx, ...
//======================================================================= //=======================================================================
void BRepAlgo_BooleanOperation::InitParameters() void BRepAlgo_BooleanOperation::InitParameters()
{ {

View File

@ -537,11 +537,11 @@ void BRepAlgo_DSAccess::ChangeEdgeSet
iC = myHB->GetDSCurveFromSectEdge(Edge); iC = myHB->GetDSCurveFromSectEdge(Edge);
if (!iC) { if (!iC) {
#if DEB #if DEB
cout << "Warning DSAccess:Modifs d'une Edge non implemente" << endl; cout << "Warning DSAccess: Modifications of Edge are not implemented" << endl;
#endif #endif
} }
else { else {
// Complement on the interferences Curve/Face // Complete the interferences Curve/Face
Standard_Integer iF; Standard_Integer iF;
Handle(TopOpeBRepDS_Interference) interf; Handle(TopOpeBRepDS_Interference) interf;
@ -573,7 +573,7 @@ void BRepAlgo_DSAccess::ChangeEdgeSet
} }
// Netoyage // Cleaning
Suppress(C, New); Suppress(C, New);
// Is it necessary to invert the Interferences "Edge on Fa" // Is it necessary to invert the Interferences "Edge on Fa"
@ -639,7 +639,7 @@ void BRepAlgo_DSAccess::Suppress(const TopoDS_Shape& C,
// during the parsing the Edges which come from Edge are found // during the parsing the Edges which come from Edge are found
// (= MapOfInteger : ESE) // (= MapOfInteger : ESE)
// En premier, les interferences de support 1d. // First, the interferences of support 1d.
TopExp_Explorer exp(C, TopAbs_EDGE); TopExp_Explorer exp(C, TopAbs_EDGE);
for(; exp.More(); exp.Next()) { for(; exp.More(); exp.Next()) {
const TopoDS_Shape& SectEdge = exp.Current(); const TopoDS_Shape& SectEdge = exp.Current();
@ -855,7 +855,7 @@ const TopoDS_Shape& BRepAlgo_DSAccess::Propagate
// myHB->MergeShapes(myS1,t1,myS2,t2); // myHB->MergeShapes(myS1,t1,myS2,t2);
//POP pour NT; //POP for NT;
static TopoDS_Shape bid; static TopoDS_Shape bid;
return bid; return bid;
} }
@ -951,9 +951,9 @@ const TopTools_ListOfShape& BRepAlgo_DSAccess::Modified (const TopoDS_Shape& Sha
BRepAlgo_CheckStatus BRepAlgo_DSAccess::Check() BRepAlgo_CheckStatus BRepAlgo_DSAccess::Check()
{ {
// TopOpeBRepDS_Check Ck(HDS); // TopOpeBRepDS_Check Ck(HDS);
// to be precised : in Ck, there is a possibility to know // to be precised : in Ck, there is a possibility to know
// exactly the n*n of shapes/points/curves/surfaces, // exactly the n*n of shapes/points/curves/surfaces,
// which are not correct in the DS. // which are not correct in the DS.
// Standard_Boolean IsOK = Ck.ChkIntgSamDom() ; // Standard_Boolean IsOK = Ck.ChkIntgSamDom() ;
// IsOK = IsOK && Ck.OneVertexOnPnt(); // IsOK = IsOK && Ck.OneVertexOnPnt();
// IsOK = IsOK && Ck.ChkIntg(); // IsOK = IsOK && Ck.ChkIntg();
@ -975,7 +975,7 @@ BRepAlgo_CheckStatus BRepAlgo_DSAccess::Check()
// //
// if iE1 and iE2 are Faces : // if iE1 and iE2 are Faces :
// for each of faces F1 and F2, explode into Edges // for each of faces F1 and F2, explode into Edges
// for each Edge : // for each Edge :
// remove the interferences of a SectEdge vertex // remove the interferences of a SectEdge vertex
// on geometry. If there is no other interferences attached to // on geometry. If there is no other interferences attached to
// these Edges, and if these Edges are not SameDomain, // these Edges, and if these Edges are not SameDomain,
@ -1063,8 +1063,8 @@ void BRepAlgo_DSAccess::RemoveEdgeInterferences
//======================================================================= //=======================================================================
//function : RemoveEdgeInterferences //function : RemoveEdgeInterferences
//purpose : case of SectEdge coming from Curve //purpose : case of SectEdge coming from Curve
// for each of faces F1 and F2, explode into Edges // for each of faces F1 and F2, explode into Edges
// for each Edge : // for each Edge :
// remove the interferences that have a vertex of SectEdge // remove the interferences that have a vertex of SectEdge
// as a geometry. If no other interferences are attached to // as a geometry. If no other interferences are attached to
// these Edges, and if the Edges are not SameDomain, // these Edges, and if the Edges are not SameDomain,
@ -1097,8 +1097,8 @@ void BRepAlgo_DSAccess::RemoveEdgeInterferences
// DSEdge (= E1 or E2) : // DSEdge (= E1 or E2) :
// a) if DSEdge is not SameDomain -> the edge is Removed // a) if DSEdge is not SameDomain -> the edge is Removed
// b) if among other interferences of DSEdge of // b) if among other interferences of DSEdge of
// GeomtryType == VERTEX, il n'en existe pas qui soient // GeomtryType == VERTEX, there is none
// avec une Edge de DSFace(= F1 ou F2) // with Edge of DSFace(= F1 or F2)
// if DSFace has no more interferences and is not SameDomain, // if DSFace has no more interferences and is not SameDomain,
// make unkeep DSFace. // make unkeep DSFace.
//======================================================================= //=======================================================================

View File

@ -127,14 +127,14 @@ void BRepAlgo_FaceRestrictor::Perform()
TopTools_ListIteratorOfListOfShape it(wires); TopTools_ListIteratorOfListOfShape it(wires);
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// recuperation la geometrie de la face de reference. // return geometry of the reference face.
//-------------------------------------------------------------------- //--------------------------------------------------------------------
TopLoc_Location L; TopLoc_Location L;
const Handle(Geom_Surface)& S = BRep_Tool::Surface(myFace,L); const Handle(Geom_Surface)& S = BRep_Tool::Surface(myFace,L);
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// test si les edges sont sur S. sinon ajout de S sur la premiere pcurve. // test if edges are on S. otherwise add S to the first pcurve.
// ou projection de l edge sur F. // or projection of the edge on F.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
TopExp_Explorer Exp; TopExp_Explorer Exp;
// BRep_Builder BB; // BRep_Builder BB;
@ -143,7 +143,7 @@ void BRepAlgo_FaceRestrictor::Perform()
TopOpeBRepBuild_WireToFace WTF; TopOpeBRepBuild_WireToFace WTF;
for ( ; it.More(); it.Next()) { for ( ; it.More(); it.Next()) {
// mise a jour de la surface sur les edges. // update the surface on edges.
const TopoDS_Wire& W = TopoDS::Wire(it.Value()); const TopoDS_Wire& W = TopoDS::Wire(it.Value());
for (Exp.Init(W,TopAbs_EDGE); Exp.More(); Exp.Next()) { for (Exp.Init(W,TopAbs_EDGE); Exp.More(); Exp.Next()) {
@ -152,13 +152,13 @@ void BRepAlgo_FaceRestrictor::Perform()
Handle(Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(E,S,L,f,l); Handle(Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(E,S,L,f,l);
if (C2.IsNull()) { if (C2.IsNull()) {
// pas de pcurve sur la surface de reference. // no pcurve on the reference surface.
if (modeProj) { if (modeProj) {
// Projection de la courbe 3d sur la surface. // Projection of the 3D curve on surface.
ProjCurve3d ( E, S, L); ProjCurve3d ( E, S, L);
} }
else { else {
// recuperation de la premiere pcurve qui est colle sur <S> // return the first pcurve glued on <S>
Standard_Boolean YaPCurve = ChangePCurve (E, S, L); Standard_Boolean YaPCurve = ChangePCurve (E, S, L);
if (!YaPCurve) { if (!YaPCurve) {
ProjCurve3d (E, S, L); ProjCurve3d (E, S, L);
@ -315,7 +315,7 @@ static void BuildFaceIn( TopoDS_Face& F,
if (!KeyContains.IsBound(W) || KeyContains(W).IsEmpty()) return; if (!KeyContains.IsBound(W) || KeyContains(W).IsEmpty()) return;
// Suppression de W dans les KeyIsIn. // Removal of W in KeyIsIn.
// for (TopTools_ListIteratorOfListOfShape it(KeyContains(W)); it.More(); it.Next()) { // for (TopTools_ListIteratorOfListOfShape it(KeyContains(W)); it.More(); it.Next()) {
TopTools_ListIteratorOfListOfShape it; TopTools_ListIteratorOfListOfShape it;
@ -377,7 +377,7 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
myDone = Standard_False; myDone = Standard_False;
TopTools_ListIteratorOfListOfShape it(wires); TopTools_ListIteratorOfListOfShape it(wires);
//--------------------------------------------------------- //---------------------------------------------------------
// Reorientation de tous les wires fermes matiere a gauche. // Reorientation of all closed wires to the left.
//--------------------------------------------------------- //---------------------------------------------------------
for (; it.More(); it.Next()) { for (; it.More(); it.Next()) {
TopoDS_Wire& W = TopoDS::Wire(it.Value()); TopoDS_Wire& W = TopoDS::Wire(it.Value());
@ -395,7 +395,7 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
} }
} }
//--------------------------------------------------------- //---------------------------------------------------------
// Classification des wires les uns par rapport aux autres. // Classification of wires ones compared to the others.
//--------------------------------------------------------- //---------------------------------------------------------
Standard_Integer j,i = 1; Standard_Integer j,i = 1;
@ -442,7 +442,7 @@ void BRepAlgo_FaceRestrictor::PerformWithCorrection()
B.Add (NewFace,W); B.Add (NewFace,W);
faces.Append(NewFace); faces.Append(NewFace);
//-------------------------------------------- //--------------------------------------------
// Construction d une face par wire exterieur. // Construction of a face by exterior wire.
//-------------------------------------------- //--------------------------------------------
BuildFaceIn(NewFace,W, keyContains, keyIsIn, TopAbs_FORWARD, faces); BuildFaceIn(NewFace,W, keyContains, keyIsIn, TopAbs_FORWARD, faces);
} }

View File

@ -69,7 +69,7 @@ void BRepAlgo_Loop::Init(const TopoDS_Face& F)
//======================================================================= //=======================================================================
//function : Bubble //function : Bubble
//purpose : Ordonne la sequence de vertex en parametre croissant. //purpose : Orders the sequence of vertices by increasing parameter.
//======================================================================= //=======================================================================
static void Bubble(const TopoDS_Edge& E, static void Bubble(const TopoDS_Edge& E,
@ -140,9 +140,9 @@ void BRepAlgo_Loop::AddConstEdges(const TopTools_ListOfShape& LE)
//======================================================================= //=======================================================================
//function : UpdateClosedEdge //function : UpdateClosedEdge
//purpose : Si le premier ou dernier vertex d intersection //purpose : If the first or the last vertex of intersection
// coincide avec le vertex de fermeture il est supprime de SV. // coincides with the closing vertex, it is removed from SV.
// il sera ajoute au debut et a la fin de SV par l appelant. // it will be added at the beginning and the end of SV by the caller.
//======================================================================= //=======================================================================
static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E, static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
@ -175,7 +175,7 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
if (!VB[0].IsSame(VB[1])) { if (!VB[0].IsSame(VB[1])) {
#ifdef DEB #ifdef DEB
if (AffichLoop) if (AffichLoop)
cout <<" Deux vertex different sur vertex de fermeture"<<endl; cout <<"Two different vertices on the closing vertex"<<endl;
#endif #endif
} }
else { else {
@ -199,7 +199,7 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
static void RemovePendingEdges(TopTools_DataMapOfShapeListOfShape& MVE) static void RemovePendingEdges(TopTools_DataMapOfShapeListOfShape& MVE)
{ {
//-------------------------------- //--------------------------------
// Suppression des edges pendants. // Remove hanging edges.
//-------------------------------- //--------------------------------
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Mapit; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape Mapit;
TopTools_ListOfShape ToRemove; TopTools_ListOfShape ToRemove;
@ -276,10 +276,10 @@ static Standard_Boolean SamePnt2d(TopoDS_Vertex V,
//======================================================================= //=======================================================================
//function : SelectEdge //function : SelectEdge
//purpose : Trouve l edge <NE> connexe a <CE> par le vertex <CV> dans //purpose : Find edge <NE> connected to <CE> by vertex <CV> in the
// la liste <LE>. <NE> est supprime de la liste. Si <CE> est // list <LE>. <NE> is removed from the list. If <CE> is
// aussi dans la liste <LE> avec la meme orientation, il est // also in the list <LE> with the same orientation, it is
// supprime de la liste. // removed from the list.
//======================================================================= //=======================================================================
static Standard_Boolean SelectEdge(const TopoDS_Face& F, static Standard_Boolean SelectEdge(const TopoDS_Face& F,
@ -293,7 +293,7 @@ static Standard_Boolean SelectEdge(const TopoDS_Face& F,
#ifdef DEB #ifdef DEB
if (AffichLoop) { if (AffichLoop) {
if ( LE.Extent() > 2) { if ( LE.Extent() > 2) {
cout <<"vertex sur plus de 2 edges dans une face."<<endl; cout <<"vertex on more than 2 edges in a face."<<endl;
} }
} }
#endif #endif
@ -305,12 +305,12 @@ static Standard_Boolean SelectEdge(const TopoDS_Face& F,
} }
if (LE.Extent() > 1) { if (LE.Extent() > 1) {
//-------------------------------------------------------------- //--------------------------------------------------------------
// Plusieurs edges possibles. // Several edges possible.
// - Test les edges differentes de CE , Selection de l edge // - Test edges different from CE , Selection of edge
// pour lequel CV a les U,V les plus proches dans la face // for which CV has U,V closer to the face
// que ceux correspondant a CE. // than corresponding to CE.
// - Si plusieurs edge donne des representation < la tolerance. // - If several edges give representation less than the tolerance.
// discrimination sur les tangentes. // discrimination on tangents.
//-------------------------------------------------------------- //--------------------------------------------------------------
TopLoc_Location L; TopLoc_Location L;
Standard_Real f,l; Standard_Real f,l;
@ -518,7 +518,7 @@ void BRepAlgo_Loop::Perform()
#endif #endif
//------------------------------------------------ //------------------------------------------------
// Decoupe des edges // Cut edges
//------------------------------------------------ //------------------------------------------------
for (Mapit.Initialize(myVerOnEdges); Mapit.More(); Mapit.Next()) { for (Mapit.Initialize(myVerOnEdges); Mapit.More(); Mapit.Next()) {
TopTools_ListOfShape LCE; TopTools_ListOfShape LCE;
@ -532,7 +532,7 @@ void BRepAlgo_Loop::Perform()
//----------------------------------- //-----------------------------------
TopTools_DataMapOfShapeListOfShape MVE; TopTools_DataMapOfShapeListOfShape MVE;
// ajout des edges decoupees. // add cut edges.
for (Mapit.Initialize(myNewEdges); Mapit.More(); Mapit.Next()) { for (Mapit.Initialize(myNewEdges); Mapit.More(); Mapit.Next()) {
for (itl.Initialize(myNewEdges(Mapit.Key())); itl.More(); itl.Next()) { for (itl.Initialize(myNewEdges(Mapit.Key())); itl.More(); itl.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl.Value()); TopoDS_Edge& E = TopoDS::Edge(itl.Value());
@ -540,9 +540,9 @@ void BRepAlgo_Loop::Perform()
} }
} }
// ajout des edges const // add const edges
// Les edges de couture peuvent etre doubles ou non dans myConstEdges // Sewn edges can be doubled or not in myConstEdges
// => appel une seule fois StoreInMVE qui se charge de les doubler // => call only once StoreInMVE which should double them
TopTools_MapOfShape DejaVu; TopTools_MapOfShape DejaVu;
for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) { for (itl.Initialize(myConstEdges); itl.More(); itl.Next()) {
TopoDS_Edge& E = TopoDS::Edge(itl.Value()); TopoDS_Edge& E = TopoDS::Edge(itl.Value());
@ -568,7 +568,7 @@ void BRepAlgo_Loop::Perform()
#endif #endif
//----------------------------------------------- //-----------------------------------------------
// Construction des wires et des nouvelles faces. // Construction of wires and new faces.
//---------------------------------------------- //----------------------------------------------
TopoDS_Vertex VF,VL,CV; TopoDS_Vertex VF,VL,CV;
TopoDS_Edge CE,NE,EF; TopoDS_Edge CE,NE,EF;
@ -581,19 +581,19 @@ void BRepAlgo_Loop::Perform()
while (!MVE.IsEmpty()) { while (!MVE.IsEmpty()) {
B.MakeWire(NW); B.MakeWire(NW);
//-------------------------------- //--------------------------------
// Suppression des edges pendants. // Removal of hanging edges.
//-------------------------------- //--------------------------------
RemovePendingEdges(MVE); RemovePendingEdges(MVE);
if (MVE.IsEmpty()) break; if (MVE.IsEmpty()) break;
//-------------------------------- //--------------------------------
// Edge de depart. // Start edge.
//-------------------------------- //--------------------------------
Mapit.Initialize(MVE); Mapit.Initialize(MVE);
EF = CE = TopoDS::Edge(Mapit.Value().First()); EF = CE = TopoDS::Edge(Mapit.Value().First());
TopExp::Vertices(CE,V1,V2); TopExp::Vertices(CE,V1,V2);
//-------------------------------- //--------------------------------
// VF vertex debut du nouveau wire // VF vertex start of new wire
//-------------------------------- //--------------------------------
if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1;} if (CE.Orientation() == TopAbs_FORWARD) { CV = VF = V1;}
else { CV = VF = V2;} else { CV = VF = V2;}
@ -608,7 +608,7 @@ void BRepAlgo_Loop::Perform()
while (!End) { while (!End) {
//------------------------------- //-------------------------------
// Construction d un wire. // Construction of a wire.
//------------------------------- //-------------------------------
TopExp::Vertices(CE,V1,V2); TopExp::Vertices(CE,V1,V2);
if (!CV.IsSame(V1)) CV = V1; else CV = V2; if (!CV.IsSame(V1)) CV = V1; else CV = V2;
@ -628,7 +628,7 @@ void BRepAlgo_Loop::Perform()
} }
} }
//-------------------------------------------------- //--------------------------------------------------
// Ajout du nouveau wire dans l ensemble des wires // Add new wire to the set of wires
//------------------------------------------------ //------------------------------------------------
Standard_Real Tol = 0.001; //5.e-05; //5.e-07; Standard_Real Tol = 0.001; //5.e-05; //5.e-07;
TopExp_Explorer explo( NW, TopAbs_VERTEX ); TopExp_Explorer explo( NW, TopAbs_VERTEX );
@ -690,15 +690,15 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
SV.Append(it.Value()); SV.Append(it.Value());
} }
//-------------------------------- //--------------------------------
// Tri des vertex sur l edge. // Parse vertices on the edge.
//-------------------------------- //--------------------------------
Bubble (WE,SV); Bubble (WE,SV);
Standard_Integer NbVer = SV.Length(); Standard_Integer NbVer = SV.Length();
//---------------------------------------------------------------- //----------------------------------------------------------------
// Construction des nouvelles edges. // Construction of new edges.
// Remarque : les vertex extremites de l edges ne sont pas // Note : vertices at the extremities of edges are not
// forcement dans la liste des vertex // onligatorily in the list of vertices
//---------------------------------------------------------------- //----------------------------------------------------------------
if (SV.IsEmpty()) { if (SV.IsEmpty()) {
NE.Append(E); NE.Append(E);
@ -721,9 +721,9 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
} }
} }
//---------------------------------------------------- //----------------------------------------------------
// Traitement des edges fermes // Processing of closed edges
// Si un vertex d intersection est sur le vertex // If a vertex of intersection is on the common vertex
// commun il doit apparaitre eb debut et en fin de SV. // it should appear at the beginning and end of SV.
//---------------------------------------------------- //----------------------------------------------------
TopoDS_Vertex VCEI; TopoDS_Vertex VCEI;
if (!VF.IsNull() && VF.IsSame(VL)) { if (!VF.IsNull() && VF.IsSame(VL)) {
@ -741,7 +741,7 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
} }
else { else {
//----------------------------------------- //-----------------------------------------
// Ajout eventuel des extremites de l edge. // Eventually all extremities of the edge.
//----------------------------------------- //-----------------------------------------
if (!VF.IsNull() && !VF.IsSame(SV.First())) SV.Prepend(VF); if (!VF.IsNull() && !VF.IsSame(SV.First())) SV.Prepend(VF);
if (!VL.IsNull() && !VL.IsSame(SV.Last ())) SV.Append (VL); if (!VL.IsNull() && !VL.IsSame(SV.Last ())) SV.Append (VL);
@ -762,7 +762,7 @@ void BRepAlgo_Loop::CutEdge (const TopoDS_Edge& E,
V2 = TopoDS::Vertex(SV.First()); V2 = TopoDS::Vertex(SV.First());
SV.Remove(1); SV.Remove(1);
//------------------------------------------- //-------------------------------------------
// Copie de l edge et restriction par V1 V2. // Copy the edge and restriction by V1 V2.
//------------------------------------------- //-------------------------------------------
TopoDS_Shape NewEdge = WE.EmptyCopied(); TopoDS_Shape NewEdge = WE.EmptyCopied();
TopoDS_Shape aLocalEdge = V1.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalEdge = V1.Oriented(TopAbs_FORWARD);

View File

@ -375,17 +375,17 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
prj = MKed.Edge(); prj = MKed.Edge();
} }
else { else {
// On teste si la solution n'est pas degeneree pour mettre le // It is tested if the solution is not degenerated to set the
// flag a l'edge, on prend quelques points, on regarde si le nuage de // flag on edge, one takes several points, checks if the cloud of
// points a un diametre inferieur a la tolerance 3D // points has less diameter than the tolerance 3D
Degenerated = Standard_True; Degenerated = Standard_True;
Standard_Real Dist; Standard_Real Dist;
Handle(Geom_BSplineCurve) BS3d = Handle(Geom_BSplineCurve)::DownCast( appr.Curve3d()); Handle(Geom_BSplineCurve) BS3d = Handle(Geom_BSplineCurve)::DownCast( appr.Curve3d());
gp_Pnt P1(0.,0.,0.),PP; // skl : I change "P" to "PP" gp_Pnt P1(0.,0.,0.),PP; // skl : I change "P" to "PP"
Standard_Integer NbPoint,ii ; // skl : I change "i" to "ii" Standard_Integer NbPoint,ii ; // skl : I change "i" to "ii"
Standard_Real Par,DPar; Standard_Real Par,DPar;
// on commence avec 3 points pour rejeter les aretes non degenerees // start from 3 points to reject non degenerated edges
// tres rapidement // very fast
NbPoint =3; NbPoint =3;
DPar = (BS3d->LastParameter()-BS3d->FirstParameter())/(NbPoint-1); DPar = (BS3d->LastParameter()-BS3d->FirstParameter())/(NbPoint-1);
for (ii=0;ii<NbPoint;ii++) for (ii=0;ii<NbPoint;ii++)
@ -404,8 +404,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
break; break;
} }
} }
// si le test passe on fait un test plus precis // if the test passes a more exact test with 10 points
// avec 10 points
if (Degenerated) { if (Degenerated) {
P1.SetCoord(0.,0.,0.); P1.SetCoord(0.,0.,0.);
NbPoint =10; NbPoint =10;
@ -460,8 +459,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if(myFaceBounds) { if(myFaceBounds) {
// Trimming edges by face bounds // Trimming edges by face bounds
// si la solution est degeneree, on evite d'utiliser le BoolTool // if the solution is degenerated, use of BoolTool is avoided
// qui n'aime pas ca.
#ifdef DEBUG #ifdef DEBUG
InitChron(chr_booltool); InitChron(chr_booltool);
#endif #endif
@ -509,7 +507,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
} }
else { else {
#ifdef DEB #ifdef DEB
cout << " BooleanOperations : pas de solution " << endl; cout << " BooleanOperations : no solution " << endl;
#endif #endif
BRepTopAdaptor_FClass2d classifier(TopoDS::Face(Faces->Value(j)), BRepTopAdaptor_FClass2d classifier(TopoDS::Face(Faces->Value(j)),
@ -544,9 +542,9 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
} }
myDescendants.Bind(Edges->Value(i), DescenList); myDescendants.Bind(Edges->Value(i), DescenList);
} }
// JPI : la creation eventuelle d'un wire est reportee dans une methode specifique // JPI : eventual wire creation is reported in a specific method
// BuilWire qui pourra etre appelee par l'utilisateur. Sinon, on perdait les // BuilWire that can be called by the user. Otherwise, the
// relations des map myAncestorMap, myCorresp. // relations of map myAncestorMap, myCorresp will be lost.
if(YaVertexRes) BB.Add(myRes, VertexRes); if(YaVertexRes) BB.Add(myRes, VertexRes);
@ -675,8 +673,8 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
if (MW.IsDone()) if (MW.IsDone())
{ {
const TopoDS_Shape& Wire = MW.Shape(); const TopoDS_Shape& Wire = MW.Shape();
// Si le wire resultat contient le meme d'arete qu'au depart OK // If the resulting wire contains the same edge as at the beginning OK
// sinon le resultat est vraisemblablement constitue de plusieurs wires. // otherwise the result really consists of several wires.
TopExp_Explorer exp2(Wire,TopAbs_EDGE); TopExp_Explorer exp2(Wire,TopAbs_EDGE);
Standard_Integer NbEdges = 0; Standard_Integer NbEdges = 0;
for (;exp2.More(); exp2.Next()) NbEdges++; for (;exp2.More(); exp2.Next()) NbEdges++;

View File

@ -35,8 +35,8 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
break; break;
case TopAbs_SHELL: case TopAbs_SHELL:
{ {
// si le shell contient des bords libres qui n'appartiennent pas aux // if the shell contains free borders that do not belong to the
// bord libres des bouchons ( Boundary) on l'enleve. // free borders of caps ( Boundary) it is removed.
TopTools_IndexedDataMapOfShapeListOfShape Map; TopTools_IndexedDataMapOfShapeListOfShape Map;
TopExp::MapShapesAndAncestors(S,TopAbs_EDGE,TopAbs_FACE,Map); TopExp::MapShapesAndAncestors(S,TopAbs_EDGE,TopAbs_FACE,Map);
@ -55,7 +55,7 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
case TopAbs_COMPOUND: case TopAbs_COMPOUND:
case TopAbs_SOLID: case TopAbs_SOLID:
{ {
// on itere sur les sous-shape et on ajoute les non vides. // iterate on sub-shapes and add non-empty.
TopoDS_Iterator it(S); TopoDS_Iterator it(S);
TopoDS_Shape SubShape; TopoDS_Shape SubShape;
Standard_Boolean NbSub = 0; Standard_Boolean NbSub = 0;

View File

@ -3,8 +3,7 @@
// Author: Laurent BOURESCHE // Author: Laurent BOURESCHE
// Author: Jacques GOUSSARD // Author: Jacques GOUSSARD
// <lbo@pomalox.paris1.matra-dtv.fr> // <lbo@pomalox.paris1.matra-dtv.fr>
// Modif : jlr le 28/07/97 modif de section pour Edge/Face
// modif de set (courbe bornee)
#include <BRepBlend_RstRstConstRad.ixx> #include <BRepBlend_RstRstConstRad.ixx>
#include <math_Gauss.hxx> #include <math_Gauss.hxx>
#include <math_SVD.hxx> #include <math_SVD.hxx>

View File

@ -3,8 +3,7 @@
// Author: Laurent BOURESCHE // Author: Laurent BOURESCHE
// Author: Jacques GOUSSARD // Author: Jacques GOUSSARD
// <lbo@pomalox.paris1.matra-dtv.fr> // <lbo@pomalox.paris1.matra-dtv.fr>
// Modif : jlr le 28/07/97 modif de section pour Edge/Face
// modif de set (courbe bornee)
#include <BRepBlend_RstRstEvolRad.ixx> #include <BRepBlend_RstRstEvolRad.ixx>
#include <math_Gauss.hxx> #include <math_Gauss.hxx>
#include <math_SVD.hxx> #include <math_SVD.hxx>
@ -357,7 +356,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol,
Sina = nplan.Dot(n1.Crossed(n2)); Sina = nplan.Dot(n1.Crossed(n2));
if (choix%2 != 0) { if (choix%2 != 0) {
Sina = -Sina; //nplan est change en -nplan Sina = -Sina; //nplan is changed into -nplan
} }
Angle = ACos(Cosa); Angle = ACos(Cosa);
@ -1013,10 +1012,10 @@ Standard_Boolean BRepBlend_RstRstEvolRad::Section(const Blend_Point& P,
} }
else { else {
d1rst1rst2 *= 0.5; d1rst1rst2 *= 0.5;
// Normale a la courbe en P1 // Normal to the curve in P1
d1n1 = - (d1rst1rst2 + Invdray * n1) / ray; d1n1 = - (d1rst1rst2 + Invdray * n1) / ray;
// Normale a la courbe en P2 // Normal to the curve in P2
d1n2 = (d1rst1rst2 - Invdray * n2) / ray; d1n2 = (d1rst1rst2 - Invdray * n2) / ray;
} }
} }

View File

@ -3,8 +3,7 @@
// Author: Laurent BOURESCHE // Author: Laurent BOURESCHE
// Author: Jacques GOUSSARD // Author: Jacques GOUSSARD
// <lbo@pomalox.paris1.matra-dtv.fr> // <lbo@pomalox.paris1.matra-dtv.fr>
// Modif : jlr le 28/07/97 modif de section pour Edge/Face
// modif de set (courbe bornee)
#include <BRepBlend_SurfRstConstRad.ixx> #include <BRepBlend_SurfRstConstRad.ixx>
#include <math_Gauss.hxx> #include <math_Gauss.hxx>
#include <math_SVD.hxx> #include <math_SVD.hxx>

View File

@ -1287,7 +1287,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::CheckDeflectionOnSurf(const Blend_Poi
{ {
//Controls 3d of Blend_CSWalking. //Controls 3d of Blend_CSWalking.
// rule by tests in U4 corresponds to 11.478 d //rule by tests in U4 corresponds to 11.478 d
const Standard_Real CosRef3D = 0.98; const Standard_Real CosRef3D = 0.98;
Standard_Real Cosi=0, Cosi2=0; Standard_Real Cosi=0, Cosi2=0;
Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint(); Standard_Boolean curpointistangent = CurPoint.IsTangencyPoint();

View File

@ -138,7 +138,7 @@ void BRepBuilderAPI_FindPlane::Init(const TopoDS_Shape& S,
Standard_Real dist = p0.SquareDistance(points(i)); Standard_Real dist = p0.SquareDistance(points(i));
if (dist > disMax) { if (dist > disMax) {
disMax = dist; disMax = dist;
p1 = points(i); // ca va plus vite de stocker le point, sinon il faut chercher une valeur dans une sequence p1 = points(i); // it will be faster to store the point, otherwise it is necessary to find a value in a sequence
} }
} }

View File

@ -21,8 +21,8 @@
// Add of SameParameter call // Add of SameParameter call
//-- lbr le 1er avril 97 //-- lbr April 1 97
//-- dpf le 10 decembre 1997 Traitement des collections de pcurve //-- dpf December 10 1997 Processing of pcurve collections
//rln 02.02.99 BUC60449 Making compilable on NT in DEB mode //rln 02.02.99 BUC60449 Making compilable on NT in DEB mode
//rln 02.02.99 BUC60449 Protection against exception on NT //rln 02.02.99 BUC60449 Protection against exception on NT
@ -146,7 +146,7 @@ Handle(Geom2d_Curve) BRepBuilderAPI_Sewing::SameRange(const Handle(Geom2d_Curve)
//======================================================================= //=======================================================================
//function : WhichFace //function : WhichFace
//purpose : Give the face dont ledge est le bord //purpose : Give the face whose edge is the border
//======================================================================= //=======================================================================
TopoDS_Face BRepBuilderAPI_Sewing::WhichFace(const TopoDS_Edge& theEdg, const Standard_Integer index) const TopoDS_Face BRepBuilderAPI_Sewing::WhichFace(const TopoDS_Edge& theEdg, const Standard_Integer index) const

View File

@ -147,7 +147,7 @@ void BRepCheck_Face::InContext(const TopoDS_Shape& S)
void BRepCheck_Face::Blind() void BRepCheck_Face::Blind()
{ {
if (!myBlind) { if (!myBlind) {
// rien de plus que dans le minimum // nothing more than in the minimum
myBlind = Standard_True; myBlind = Standard_True;
} }
} }
@ -174,14 +174,14 @@ BRepCheck_Status BRepCheck_Face::IntersectWires(const Standard_Boolean Update)
TopExp_Explorer exp1,exp2; TopExp_Explorer exp1,exp2;
// on mape les wires // the wires are mapped
exp1.Init(myShape.Oriented(TopAbs_FORWARD),TopAbs_WIRE); exp1.Init(myShape.Oriented(TopAbs_FORWARD),TopAbs_WIRE);
TopTools_ListOfShape theListOfShape; TopTools_ListOfShape theListOfShape;
while (exp1.More()) { while (exp1.More()) {
if (!myMapImb.IsBound(exp1.Current())) { if (!myMapImb.IsBound(exp1.Current())) {
myMapImb.Bind(exp1.Current(), theListOfShape); myMapImb.Bind(exp1.Current(), theListOfShape);
} }
else { // on a 2 fois le meme wire... else { // the same wire is met twice...
myIntres = BRepCheck_RedundantWire; myIntres = BRepCheck_RedundantWire;
if (Update) { if (Update) {
BRepCheck::Add(myMap(myShape),myIntres); BRepCheck::Add(myMap(myShape),myIntres);
@ -277,7 +277,7 @@ BRepCheck_Status BRepCheck_Face::ClassifyWires(const Standard_Boolean Update)
Standard_Boolean WireBienOriente = Standard_False; Standard_Boolean WireBienOriente = Standard_False;
if(FClass2d.PerformInfinitePoint() != TopAbs_OUT) { if(FClass2d.PerformInfinitePoint() != TopAbs_OUT) {
WireBienOriente=Standard_True; WireBienOriente=Standard_True;
//le wire donne definit un trou // the given wire defines a hole
myMapImb.UnBind(wir1); myMapImb.UnBind(wir1);
myMapImb.Bind(wir1.Reversed(), theListOfShape); myMapImb.Bind(wir1.Reversed(), theListOfShape);
} }
@ -293,10 +293,10 @@ BRepCheck_Status BRepCheck_Face::ClassifyWires(const Standard_Boolean Update)
} }
} }
} }
// On doit avoir 1 wire qui contient tous les autres, et les autres // It is required to have 1 wire that contains all others, and the others should not
// ne contenant rien (cas solide fini) ou // contain anything (case solid ended) or
// que des wires ne contenant rien : dans ce cas les wires doivent etre // the wires do not contain anything : in this case the wires should be
// des trous dans une face infinie. // holes in an infinite face.
TopoDS_Wire Wext; TopoDS_Wire Wext;
for (TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(myMapImb); for (TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(myMapImb);
itm.More(); itm.More();
@ -325,7 +325,7 @@ BRepCheck_Status BRepCheck_Face::ClassifyWires(const Standard_Boolean Update)
return myImbres; return myImbres;
} }
} }
// sortie sans erreurs // quit without errors
if (Update) { if (Update) {
BRepCheck::Add(myMap(myShape),myImbres); BRepCheck::Add(myMap(myShape),myImbres);
} }
@ -393,7 +393,7 @@ BRepCheck_Status BRepCheck_Face::OrientationOfWires
const TopoDS_Wire& wir = TopoDS::Wire(exp.Current()); const TopoDS_Wire& wir = TopoDS::Wire(exp.Current());
if (!Wext.IsNull() && wir.IsSame(Wext)) { if (!Wext.IsNull() && wir.IsSame(Wext)) {
if (wir.Orientation() != Wext.Orientation()) { if (wir.Orientation() != Wext.Orientation()) {
//le wire exterieur definit un trou //the exterior wire defines a hole
if( CheckThin(wir,myShape.Oriented(TopAbs_FORWARD)) ) if( CheckThin(wir,myShape.Oriented(TopAbs_FORWARD)) )
return myOrires; return myOrires;
myOrires = BRepCheck_BadOrientationOfSubshape; myOrires = BRepCheck_BadOrientationOfSubshape;
@ -409,9 +409,9 @@ BRepCheck_Status BRepCheck_Face::OrientationOfWires
break; break;
} }
} }
// Pas de controle sur More() // No control on More()
if (itm.Key().Orientation() == wir.Orientation()) { if (itm.Key().Orientation() == wir.Orientation()) {
//le wire donne ne definit pas un trou // the given wire does not define a hole
myOrires = BRepCheck_BadOrientationOfSubshape; myOrires = BRepCheck_BadOrientationOfSubshape;
if (Update) { if (Update) {
BRepCheck::Add(myMap(myShape),myOrires); BRepCheck::Add(myMap(myShape),myOrires);
@ -420,7 +420,7 @@ BRepCheck_Status BRepCheck_Face::OrientationOfWires
} }
} }
} }
// sortie sans erreur // quit withour error
if (Update) { if (Update) {
BRepCheck::Add(myMap(myShape),myOrires); BRepCheck::Add(myMap(myShape),myOrires);
} }

View File

@ -70,7 +70,7 @@ const BRepCheck_ListOfStatus& BRepCheck_Result::StatusOnShape
void BRepCheck_Result::InitContextIterator() void BRepCheck_Result::InitContextIterator()
{ {
myIter.Initialize(myMap); myIter.Initialize(myMap);
// Au minimum 1 element : le Shape lui meme // At least 1 element : the Shape itself
if (myIter.Key().IsSame(myShape)) { if (myIter.Key().IsSame(myShape)) {
myIter.Next(); myIter.Next();
} }

View File

@ -54,7 +54,7 @@ BRepCheck_Vertex::BRepCheck_Vertex(const TopoDS_Vertex& V)
void BRepCheck_Vertex::Minimum() void BRepCheck_Vertex::Minimum()
{ {
if (!myMin) { if (!myMin) {
// consisterait a verifier l`existence d`un point 3D // checks the existence of a point 3D
BRepCheck_ListOfStatus thelist; BRepCheck_ListOfStatus thelist;
myMap.Bind(myShape, thelist); myMap.Bind(myShape, thelist);
myMap(myShape).Append(BRepCheck_NoError); myMap(myShape).Append(BRepCheck_NoError);
@ -85,7 +85,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
} }
if (!exp.More()) { if (!exp.More()) {
BRepCheck::Add(myMap(S),BRepCheck_SubshapeNotInShape); BRepCheck::Add(myMap(S),BRepCheck_SubshapeNotInShape);
return; // on sort return; // leaves
} }
@ -98,7 +98,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
case TopAbs_EDGE: case TopAbs_EDGE:
{ {
// On essaie de retrouver le vertex sur l`edge // Try to find the vertex on the edge
const TopoDS_Edge& E = TopoDS::Edge(S); const TopoDS_Edge& E = TopoDS::Edge(S);
TopoDS_Iterator itv(E.Oriented(TopAbs_FORWARD)); TopoDS_Iterator itv(E.Oriented(TopAbs_FORWARD));
@ -115,7 +115,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
VF.Orientation() == TopAbs_REVERSED) || VF.Orientation() == TopAbs_REVERSED) ||
(VFind.Orientation() == TopAbs_REVERSED && (VFind.Orientation() == TopAbs_REVERSED &&
VF.Orientation() == TopAbs_FORWARD)) { VF.Orientation() == TopAbs_FORWARD)) {
// on a le vertex a la fois F et R sur l`edge // the vertex on the edge is at once F and R
multiple = Standard_True; multiple = Standard_True;
} }
if (VFind.Orientation() != TopAbs_FORWARD && if (VFind.Orientation() != TopAbs_FORWARD &&
@ -130,11 +130,11 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
itv.Next(); itv.Next();
} }
// on est sur que VFind n`est pas nul // VFind is not null for sure
TopAbs_Orientation orv = VFind.Orientation(); TopAbs_Orientation orv = VFind.Orientation();
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape));
Tol = Max(Tol,BRep_Tool::Tolerance(E)); // a voir Tol = Max(Tol,BRep_Tool::Tolerance(E)); // to check
Tol *= Tol; Tol *= Tol;
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape()); Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape());
@ -143,14 +143,14 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
BRep_ListIteratorOfListOfPointRepresentation itpr; BRep_ListIteratorOfListOfPointRepresentation itpr;
while (itcr.More()) { while (itcr.More()) {
// Pour chaque CurveRepresentation, on verifie le parametre fourni // For each CurveRepresentation, the provided parameter is checked
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
const TopLoc_Location& loc = cr->Location(); const TopLoc_Location& loc = cr->Location();
TopLoc_Location L = (Eloc * loc).Predivided(myShape.Location()); TopLoc_Location L = (Eloc * loc).Predivided(myShape.Location());
if (cr->IsCurve3D()) { if (cr->IsCurve3D()) {
const Handle(Geom_Curve)& C = cr->Curve3D(); const Handle(Geom_Curve)& C = cr->Curve3D();
if (!C.IsNull()) { // edge non degenere if (!C.IsNull()) { // edge non degenerated
itpr.Initialize(TV->Points()); itpr.Initialize(TV->Points());
while (itpr.More()) { while (itpr.More()) {
const Handle(BRep_PointRepresentation)& pr = itpr.Value(); const Handle(BRep_PointRepresentation)& pr = itpr.Value();
@ -232,7 +232,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S)
TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location()); TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location());
Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape));
Tol = Max(Tol,BRep_Tool::Tolerance(TopoDS::Face(S))); // a voir Tol = Max(Tol,BRep_Tool::Tolerance(TopoDS::Face(S))); // to check
Tol *= Tol; Tol *= Tol;
BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points());
@ -270,11 +270,11 @@ void BRepCheck_Vertex::Blind()
if (myBlind) { if (myBlind) {
return; return;
} }
// modified by NIZHNY-MKK Fri May 7 16:43:38 2004.BEGIN // modified by NIZHNY-MKK Fri May 7 16:43:38 2004.BEGIN
// The body of this function is removed because of its useless // The body of this function is removed because of its useless
// (see specification "Substitution existing set of evaluation DRAW commands to one"). // (see specification "Substitution existing set of evaluation DRAW commands to one").
// Check all the representations of the vertex. (i-e checks the TVertex // Check all the representations of the vertex. (i-e checks the TVertex
// BRepCheck_ListOfStatus& lst = myMap(myShape); // BRepCheck_ListOfStatus& lst = myMap(myShape);
// lst.Clear(); // there was NoError... // lst.Clear(); // there was NoError...

View File

@ -3,7 +3,7 @@
// Author: Jacques GOUSSARD // Author: Jacques GOUSSARD
// <jag@bravox> // <jag@bravox>
// Modified by dpf, Fri Dec 19 15:31:03 1997 // Modified by dpf, Fri Dec 19 15:31:03 1997
// Taitement de la fermeture en 2d. // Processing of closing in 2d.
// //
// modified by eap Tue Dec 18 14:14:25 2001 (bug OCC23) // modified by eap Tue Dec 18 14:14:25 2001 (bug OCC23)
// Check self-intersection in case of closed edge // Check self-intersection in case of closed edge
@ -137,7 +137,7 @@ void BRepCheck_Wire::Minimum()
myMap.Bind(myShape, thelist); myMap.Bind(myShape, thelist);
BRepCheck_ListOfStatus& lst = myMap(myShape); BRepCheck_ListOfStatus& lst = myMap(myShape);
// on verifie que le wire est "connexe" == check that the wire is "connex" // check that the wire is "connex"
TopExp_Explorer exp(myShape,TopAbs_EDGE); TopExp_Explorer exp(myShape,TopAbs_EDGE);
Standard_Integer nbedge = 0; Standard_Integer nbedge = 0;
myMapVE.Clear(); myMapVE.Clear();
@ -212,7 +212,7 @@ void BRepCheck_Wire::InContext(const TopoDS_Shape& S)
case TopAbs_FACE: case TopAbs_FACE:
{ {
TopoDS_Edge ed1,ed2; // bidon TopoDS_Edge ed1,ed2;
if (myGctrl) if (myGctrl)
st = SelfIntersect(TopoDS::Face(S),ed1,ed2,Standard_True); st = SelfIntersect(TopoDS::Face(S),ed1,ed2,Standard_True);
if (st != BRepCheck_NoError) break; if (st != BRepCheck_NoError) break;
@ -240,7 +240,7 @@ void BRepCheck_Wire::InContext(const TopoDS_Shape& S)
void BRepCheck_Wire::Blind() void BRepCheck_Wire::Blind()
{ {
if (!myBlind) { if (!myBlind) {
// rien de plus que dans le minimum // nothing more that the minimum
myBlind = Standard_True; myBlind = Standard_True;
} }
} }
@ -258,12 +258,12 @@ BRepCheck_Status BRepCheck_Wire::Closed(const Standard_Boolean Update)
return myCstat; return myCstat;
} }
myCdone = Standard_True; // ce sera fait... myCdone = Standard_True;
BRepCheck_ListIteratorOfListOfStatus itl(myMap(myShape)); BRepCheck_ListIteratorOfListOfStatus itl(myMap(myShape));
if (itl.Value() != BRepCheck_NoError) { if (itl.Value() != BRepCheck_NoError) {
myCstat = itl.Value(); myCstat = itl.Value();
return myCstat; // deja enregistre return myCstat; // already saved
} }
myCstat = BRepCheck_NoError; myCstat = BRepCheck_NoError;
@ -583,8 +583,8 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
while (Index < nbOriNoDegen) { while (Index < nbOriNoDegen) {
ledge.Clear(); ledge.Clear();
ListOfPassedEdge.Clear(); ListOfPassedEdge.Clear();
// on cherche les edges qui s`enchainent sur VL si !VL.IsNull // find edges that make a chain on VL if !VL.IsNull
// sinon sur VF. // otherwise on VF.
Standard_Integer ind; Standard_Integer ind;
if (!VL.IsNull()) { if (!VL.IsNull()) {
@ -633,17 +633,17 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
TopAbs_Orientation vto = vte.Current().Orientation(); TopAbs_Orientation vto = vte.Current().Orientation();
if (!VL.IsNull()) { if (!VL.IsNull()) {
if (vto == TopAbs_FORWARD && VL.IsSame(vte.Current())) { if (vto == TopAbs_FORWARD && VL.IsSame(vte.Current())) {
// Si on travaille en 2d (face non nulle) ou // If the processing is in 2d (face not null) or
// si l'edge n'est pas degenere on l'ajoute // if the edge is not degenerated it is added
if (!F.IsNull() || !BRep_Tool::Degenerated(edg)) if (!F.IsNull() || !BRep_Tool::Degenerated(edg))
ledge.Append(edg); ledge.Append(edg);
break; break;
} }
} }
else { // VF n`est pas nul else { // VF is not null
if (vto == TopAbs_REVERSED && VF.IsSame(vte.Current())) { if (vto == TopAbs_REVERSED && VF.IsSame(vte.Current())) {
// Si on travaille en 2d (face non nulle) ou // // If the processing is in 2d (face not null) or
// si l'edge n'est pas degenere on l'ajoute // if the edge is not degenerated it is added
if (!F.IsNull() || !BRep_Tool::Degenerated(edg)) if (!F.IsNull() || !BRep_Tool::Degenerated(edg))
ledge.Append(edg); ledge.Append(edg);
break; break;
@ -660,11 +660,11 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
if (Update) { if (Update) {
BRepCheck::Add(myMap(myShape),theOstat); BRepCheck::Add(myMap(myShape),theOstat);
} }
return theOstat; // on sort return theOstat; // leave
} }
else { else {
Index--; // parce que apres Index++ et on n`a pas enchaine Index--; // because after Index++ and if there is no chain,
VL.Nullify(); // on force a enchainer sur VF VL.Nullify(); // chain on VF is forced
theEdge = theRef; theEdge = theRef;
Changedesens = Standard_True; Changedesens = Standard_True;
} }
@ -678,8 +678,8 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
} }
} }
// JAG 03/07 else if (nbconnex >= 2 && !F.IsNull()) // On essaie de voir en 2d // JAG 03/07 else if (nbconnex >= 2 && !F.IsNull()) // Try to see in 2d
else if (!F.IsNull()) { // On essaie de voir en 2d else if (!F.IsNull()) { // Try to see in 2d
TopoDS_Vertex pivot; TopoDS_Vertex pivot;
if (!VL.IsNull()) { if (!VL.IsNull()) {
pivot = VL; pivot = VL;
@ -710,7 +710,7 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
return theOstat; return theOstat;
} }
else if (nbconnex == 1) { else if (nbconnex == 1) {
// decaler le vertex // offset the vertex
for (vte.Init(ledge.First(),TopAbs_VERTEX);vte.More(); vte.Next()) { for (vte.Init(ledge.First(),TopAbs_VERTEX);vte.More(); vte.Next()) {
TopAbs_Orientation vto = vte.Current().Orientation(); TopAbs_Orientation vto = vte.Current().Orientation();
if (!VL.IsNull()) { if (!VL.IsNull()) {
@ -719,7 +719,7 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
break; break;
} }
} }
else { // VF n`est pas nul else { // VF is not null
if (vto == TopAbs_FORWARD) { if (vto == TopAbs_FORWARD) {
VF = TopoDS::Vertex(vte.Current()); VF = TopoDS::Vertex(vte.Current());
break; break;
@ -745,7 +745,7 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
return theOstat; return theOstat;
} }
// On verifie la fermeture du wire en 2d (pas fait dans Closed()) // Check the closure of the wire in 2d (not done in Closed())
TopoDS_Vertex aVRef; TopoDS_Vertex aVRef;
Standard_Boolean isCheckClose = Standard_False; Standard_Boolean isCheckClose = Standard_False;
@ -790,7 +790,7 @@ BRepCheck_Status BRepCheck_Wire::Orientation(const TopoDS_Face& F,
return theOstat; return theOstat;
} }
} }
// Fin controle fermeture 2d // End control closure 2d
Index ++; Index ++;
} }
@ -824,8 +824,8 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
TopTools_MapOfOrientedShape auxmape; TopTools_MapOfOrientedShape auxmape;
// //
ok=Standard_True; ok=Standard_True;
//-- on verifie plus loin avec les bonnes tolerances si on n a //-- check with proper tolerances if there is no
//-- pas un point dans la tolerance d un vertex. //-- point in the tolerance of a vertex.
tolint = 1.e-10; tolint = 1.e-10;
HS = new BRepAdaptor_HSurface(); HS = new BRepAdaptor_HSurface();
HS->ChangeSurface().Initialize(F,Standard_False); HS->ChangeSurface().Initialize(F,Standard_False);
@ -895,15 +895,15 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
const IntRes2d_Transition& Tr2 = IP.TransitionOfSecond(); const IntRes2d_Transition& Tr2 = IP.TransitionOfSecond();
if( Tr1.PositionOnCurve() == IntRes2d_Middle if( Tr1.PositionOnCurve() == IntRes2d_Middle
|| Tr2.PositionOnCurve() == IntRes2d_Middle) { || Tr2.PositionOnCurve() == IntRes2d_Middle) {
//-- Verification des points avec les vraies tolerances (ie Tol en 3d) //-- Checking of points with true tolerances (ie Tol in 3d)
//-- Si le point d intersection est dans la tolearnce d un des vertex //-- If the point of intersection is within the tolearnce of a vertex
//-- on considere que cette intersection est bonne (pas d erreur) //-- this intersection is considered correct (no error)
Standard_Boolean localok = Standard_False; Standard_Boolean localok = Standard_False;
Standard_Real f,l; Standard_Real f,l;
TopLoc_Location L; TopLoc_Location L;
const Handle(Geom_Curve) ConS = BRep_Tool::Curve(E1,L,f,l); const Handle(Geom_Curve) ConS = BRep_Tool::Curve(E1,L,f,l);
if(!ConS.IsNull()) { if(!ConS.IsNull()) {
//-- on va tester en 3d. (ParamOnSecond donne le m resultat) //-- try to test in 3d. (ParamOnSecond gives the same result)
P3d = ConS->Value(IP.ParamOnFirst()); P3d = ConS->Value(IP.ParamOnFirst());
P3d.Transform(L.Transformation()); P3d.Transform(L.Transformation());
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin // Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
@ -992,7 +992,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
//modified by NIZNHY-PKV Fri Oct 29 10:09:02 2010t //modified by NIZNHY-PKV Fri Oct 29 10:09:02 2010t
// //
//-- ************************************************************ //-- ************************************************************
//-- ******* I n t e r s e c t i o n C 1 e t C 2 ******** //-- ******* I n t e r s e c t i o n C 1 and C 2 ********
//-- ************************************************************ //-- ************************************************************
Inter.Perform(C1,myDomain1,C2,tabDom[j-1],tolint,tolint); Inter.Perform(C1,myDomain1,C2,tabDom[j-1],tolint,tolint);
// //
@ -1031,9 +1031,9 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
Tr2 = IP.TransitionOfSecond(); Tr2 = IP.TransitionOfSecond();
if( Tr1.PositionOnCurve() == IntRes2d_Middle if( Tr1.PositionOnCurve() == IntRes2d_Middle
|| Tr2.PositionOnCurve() == IntRes2d_Middle) { || Tr2.PositionOnCurve() == IntRes2d_Middle) {
//-- Verification des points avec les vraies tolerances (ie Tol en 3d) //-- Checking of points with true tolerances (ie Tol in 3d)
//-- Si le point d intersection est dans la tolearnce d un des vertex //-- If the point of intersection is within the tolerance of a vertex
//-- on considere que cette intersection est bonne (pas d erreur) //-- this intersection is considered correct (no error)
Standard_Boolean localok = Standard_False; Standard_Boolean localok = Standard_False;
Standard_Real f1,l1, f2, l2; Standard_Real f1,l1, f2, l2;
TopLoc_Location L, L2; TopLoc_Location L, L2;
@ -1086,10 +1086,10 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
} }
//-- -------------------------------------------------------- //-- --------------------------------------------------------
//-- Verification sur le baillement maximum entre les 2 edges //-- Check maximum yawn between 2 edges
//-- //--
//-- On verifie la distance des edges a la courbe joignant //-- Check distance from edges to the curve joining
//-- le point d intersection au vertex (s il existe) //-- the point of intersection with vertex (if exists)
if (localok == Standard_False && !CommonVertices.IsEmpty()) { if (localok == Standard_False && !CommonVertices.IsEmpty()) {
#ifdef DEB #ifdef DEB
cout << "\n------------------------------------------------------\n" <<endl; cout << "\n------------------------------------------------------\n" <<endl;
@ -1151,7 +1151,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
localok = Standard_True; localok = Standard_True;
Standard_Real tole1 = BRep_Tool::Tolerance(E1); Standard_Real tole1 = BRep_Tool::Tolerance(E1);
for (k = 2; localok && k < 9; k++) { for (k = 2; localok && k < 9; k++) {
Standard_Real u = VParaOnEdge1 + k*du1; // voyons deja voir si ca marche Standard_Real u = VParaOnEdge1 + k*du1; // check if it works
gp_Pnt P1; gp_Pnt P1;
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin // Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
if (!ConS.IsNull()) { if (!ConS.IsNull()) {
@ -1171,7 +1171,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
localok = Standard_False; localok = Standard_False;
} }
} }
//-- meme chose pour edge2 //-- same for edge2
// Modified by skv - Wed Jul 23 12:22:20 2003 OCC1764 Begin // Modified by skv - Wed Jul 23 12:22:20 2003 OCC1764 Begin
gp_Dir aTmpDir(P3d2.XYZ().Subtracted(VertexLePlusProche.XYZ())); gp_Dir aTmpDir(P3d2.XYZ().Subtracted(VertexLePlusProche.XYZ()));
@ -1179,7 +1179,7 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F,
// Modified by skv - Wed Jul 23 12:22:23 2003 OCC1764 End // Modified by skv - Wed Jul 23 12:22:23 2003 OCC1764 End
Standard_Real tole2 = BRep_Tool::Tolerance(E2); Standard_Real tole2 = BRep_Tool::Tolerance(E2);
for (k = 2; localok && k < 9; k++) { for (k = 2; localok && k < 9; k++) {
Standard_Real u = VParaOnEdge2 + k*du2; // voyons deja voir si ca marche Standard_Real u = VParaOnEdge2 + k*du2; // check if it works
gp_Pnt P2; gp_Pnt P2;
// Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin // Modified by Sergey KHROMOV - Mon Apr 15 12:34:22 2002 Begin
if (!ConS2.IsNull()) { if (!ConS2.IsNull()) {
@ -1416,8 +1416,8 @@ static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE,
if (mapE.Contains(edg)) { if (mapE.Contains(edg)) {
return; return;
} }
mapE.Add(edg); // attention, si oriented == Standard_True, edg doit mapE.Add(edg); // attention, if oriented == Standard_True, edge should
// etre FORWARD ou REVERSED. Ce n`est pas verifie. // be FORWARD or REVERSED. It is not checked.
// ============= // =============
// attention, if oriented == Standard_True, <edg> must // attention, if oriented == Standard_True, <edg> must
// be FORWARD or REVERSED. That is not checked. // be FORWARD or REVERSED. That is not checked.
@ -1425,7 +1425,7 @@ static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE,
TopExp_Explorer ex; TopExp_Explorer ex;
for (ex.Init(edg,TopAbs_VERTEX); ex.More(); ex.Next()) { for (ex.Init(edg,TopAbs_VERTEX); ex.More(); ex.Next()) {
const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current()); const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current());
// debug jag sur vertex // debug on vertex
Standard_Integer indv = mapVE.FindIndex(vtx); Standard_Integer indv = mapVE.FindIndex(vtx);
if (indv != 0) { if (indv != 0) {
for (TopTools_ListIteratorOfListOfShape itl(mapVE(indv)); itl.More(); itl.Next()) { for (TopTools_ListIteratorOfListOfShape itl(mapVE(indv)); itl.More(); itl.Next()) {
@ -1491,12 +1491,12 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE,
Standard_Real tol = Max(ures,vres); Standard_Real tol = Max(ures,vres);
if(tol<=0.0) { if(tol<=0.0) {
#ifdef DEB #ifdef DEB
//-- lbr le 29 jan 98
cout<<"BRepCheck_Wire : UResolution et VResolution = 0.0 (Face trop petite ?)"<<endl;cout.flush(); cout<<"BRepCheck_Wire : UResolution and VResolution = 0.0 (Face too small ?)"<<endl;cout.flush();
#endif #endif
} }
else { else {
tol += tol; //pour YFR. tol += tol;
} }
// //
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(Edg, F, f, l); Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(Edg, F, f, l);
@ -1565,14 +1565,14 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE,
} }
}//end of for }//end of for
// //
// Mise a jour ledge // Update edge
if (imin == 0) if (imin == 0)
if (L.Extent() == 1) { if (L.Extent() == 1) {
Standard_Boolean onjette = 0; //all right Standard_Boolean onjette = 0; //all right
Evois = TopoDS::Edge(L.First()); Evois = TopoDS::Edge(L.First());
if (dist2d > tol) { if (dist2d > tol) {
#ifdef DEB #ifdef DEB
cout<<"BRepCheckWire : controle fermeture en 2d --> faux"<<endl;cout.flush(); cout<<"BRepCheckWire : control closure in 2d --> false"<<endl;cout.flush();
#endif #endif
if(Evois.IsNull() || BRep_Tool::Degenerated(Edg) || if(Evois.IsNull() || BRep_Tool::Degenerated(Edg) ||
BRep_Tool::Degenerated(Evois)){ BRep_Tool::Degenerated(Evois)){
@ -1605,7 +1605,7 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE,
} }
#ifdef DEB #ifdef DEB
else else
cout<<"controle fermeture en 3d --> ok"<<endl;cout.flush(); cout<<"control closure in 3d --> ok"<<endl;cout.flush();
#endif #endif
} }
} }
@ -1615,7 +1615,7 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE,
} }
if(onjette) { if(onjette) {
#ifdef DEB #ifdef DEB
cout<<"controle fermeture en 3d --> faux"<<endl;cout.flush(); cout<<"control closure in 3d --> false"<<endl;cout.flush();
#endif #endif
L.Clear(); L.Clear();
} }

View File

@ -2,16 +2,16 @@
// Created: Thu Mar 10 14:52:22 1994 // Created: Thu Mar 10 14:52:22 1994
// Author: Laurent BUCHARD // Author: Laurent BUCHARD
// <lbr@fuegox> // <lbr@fuegox>
// Modifed: Portage NT 7-5-97 DPF (stdio.h) // Modifed: Porting NT 7-5-97 DPF (stdio.h)
// Apr 16 2002 eap, classification against infinite solid (occ299) // Apr 16 2002 eap, classification against infinite solid (occ299)
// Modified by skv - Thu Sep 4 12:29:30 2003 OCC578 // Modified by skv - Thu Sep 4 12:29:30 2003 OCC578
//-- Traiter le cas d un trou !! //-- Process the case of a hole!!
#define REJECTION 1 #define REJECTION 1
//-- Pour printf sur NT //-- To printf on NT
#include <stdio.h> #include <stdio.h>
#include <BRepClass3d_SolidExplorer.ixx> #include <BRepClass3d_SolidExplorer.ixx>
@ -48,7 +48,7 @@ static gp_Vec staticd1v_gp_vec;
//======================================================================= //=======================================================================
//function : FindAPointInTheFace //function : FindAPointInTheFace
//purpose : compute a point P in the face F. Param is a Real in //purpose : Compute a point P in the face F. Param is a Real in
// ]0,1[ and is used to initialise the algorithm. For // ]0,1[ and is used to initialise the algorithm. For
// different values , different points are returned. // different values , different points are returned.
//======================================================================= //=======================================================================
@ -111,7 +111,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::FindAPointInTheFace
T.Normalize(); T.Normalize();
P.SetCoord(P.X()+TolInit*T.X(),P.Y()+TolInit*T.Y()); P.SetCoord(P.X()+TolInit*T.X(),P.Y()+TolInit*T.Y());
FClassifier.Reset(gp_Lin2d(P,T),ParamInit,RealEpsilon()); //-- Longueur et Tolerance ####### FClassifier.Reset(gp_Lin2d(P,T),ParamInit,RealEpsilon()); //-- Length and Tolerance #######
TopExp_Explorer otherfaceexplorer; TopExp_Explorer otherfaceexplorer;
// Modified by Sergey KHROMOV - Tue Apr 1 11:32:51 2003 Begin // Modified by Sergey KHROMOV - Tue Apr 1 11:32:51 2003 Begin
@ -191,14 +191,14 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
void *ptr = (void*)(myMapOfInter.Find(Face)); void *ptr = (void*)(myMapOfInter.Find(Face));
if(ptr) { if(ptr) {
const IntCurvesFace_Intersector& TheIntersector = (*((IntCurvesFace_Intersector *)ptr)); const IntCurvesFace_Intersector& TheIntersector = (*((IntCurvesFace_Intersector *)ptr));
//-- On prend les 4 points dans chaque Quart de surface //-- Take 4 points in each Quarter of surface
//-- -> Index : 1 -> 16 //-- -> Index : 1 -> 16
//-- //--
//-- //--
//-- Puis on prend une matrice de points sur une grille serree //-- Then take a matrix of points on a tight grid
//-- //--
for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 X u croit for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 X u increases
for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v croit for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v increases
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
@ -210,8 +210,8 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
} }
} }
for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- 0 0 u decroit for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- 0 0 u decreases
for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- X 0 v decroit for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- X 0 v decreases
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
@ -222,8 +222,8 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
} }
} }
} }
for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- X 0 u decroit for(u=-du+(U1+U2)*0.5; u>U1; u-=du) { //-- X 0 u decreases
for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v croit for(v=dv+(V1+V2)*0.5; v<V2; v+=dv) { //-- 0 0 v increases
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
@ -234,8 +234,8 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
} }
} }
} }
for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 0 u croit for(u=du+(U1+U2)*0.5; u<U2; u+=du) { //-- 0 0 u increases
for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- 0 X v decroit for(v=-dv+(V1+V2)*0.5; v>V1; v-=dv) { //-- 0 X v decreases
if(++NbPntCalc>=IndexPoint) { if(++NbPntCalc>=IndexPoint) {
if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) { if(TheIntersector.ClassifyUVPoint(gp_Pnt2d(u,v))==TopAbs_IN) {
u_=u; v_=v; u_=u; v_=v;
@ -246,7 +246,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
} }
} }
} }
//-- le reste //-- the remainder
du = (U2-U1)/37.0; du = (U2-U1)/37.0;
dv = (V2-V1)/37.0; dv = (V2-V1)/37.0;
if(du<1e-12) du=1e-12; if(du<1e-12) du=1e-12;
@ -278,7 +278,7 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace
IndexPoint = NbPntCalc; IndexPoint = NbPntCalc;
} }
else { else {
//printf("BRepClass3d_SolidExplorer Face non trouvee ds la map \n"); //printf("BRepClass3d_SolidExplorer Face not found ds the map \n");
} }
return(BRepClass3d_SolidExplorer::FindAPointInTheFace(Face,APoint_,u_,v_,param_)); return(BRepClass3d_SolidExplorer::FindAPointInTheFace(Face,APoint_,u_,v_,param_));
@ -508,8 +508,8 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
Standard_Boolean encoreuneface = faceexplorer.More(); Standard_Boolean encoreuneface = faceexplorer.More();
if(ptfound==Standard_False && encoreuneface==Standard_False) { if(ptfound==Standard_False && encoreuneface==Standard_False) {
if(myParamOnEdge < 0.0001) { if(myParamOnEdge < 0.0001) {
//-- Ce cas se produit lorsque le point est sur le solide //-- This case takes place when the point is on the solid
//-- et ce solide est reduit a une face //-- and this solid is reduced to a face
gp_Pnt PBidon(P.X()+1.0,P.Y(),P.Z()); gp_Pnt PBidon(P.X()+1.0,P.Y(),P.Z());
gp_Vec V(P,PBidon); gp_Vec V(P,PBidon);
Par= 1.0; Par= 1.0;
@ -528,7 +528,7 @@ static Standard_Integer IsInfiniteUV (Standard_Real& U1, Standard_Real& V1,
_Par=0.0; _Par=0.0;
myReject=Standard_True; myReject=Standard_True;
#if DEB #if DEB
cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid sans face)"<<endl; cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid without face)"<<endl;
#endif #endif
//modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f //modified by NIZNHY-PKV Thu Nov 14 12:25:28 2002 f
//return ; //return ;
@ -708,7 +708,7 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
myShape = S; myShape = S;
myFirstFace = 0; myFirstFace = 0;
myParamOnEdge = 0.512345; myParamOnEdge = 0.512345;
//-- Exploration de la Map et delete sur les objets alloues //-- Exploring of the Map and removal of allocated objects
BRepClass3d_DataMapIteratorOfMapOfInter iter(myMapOfInter); BRepClass3d_DataMapIteratorOfMapOfInter iter(myMapOfInter);
@ -722,7 +722,7 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
myMapOfInter.Clear(); myMapOfInter.Clear();
myReject = Standard_True; //-- cas de solide infini (sans aucune face) myReject = Standard_True; //-- case of infinite solid (without any face)
TopExp_Explorer Expl; TopExp_Explorer Expl;
for(Expl.Init(S,TopAbs_FACE); for(Expl.Init(S,TopAbs_FACE);
@ -731,12 +731,12 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
const TopoDS_Face Face = TopoDS::Face(Expl.Current()); const TopoDS_Face Face = TopoDS::Face(Expl.Current());
void *ptr = (void *)(new IntCurvesFace_Intersector(Face,Precision::Confusion())); void *ptr = (void *)(new IntCurvesFace_Intersector(Face,Precision::Confusion()));
myMapOfInter.Bind(Face,ptr); myMapOfInter.Bind(Face,ptr);
myReject=Standard_False; //-- au moins une face dans le solide myReject=Standard_False; //-- at least one face in the solid
} }
#if DEB #if DEB
if(myReject) { if(myReject) {
cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid sans face)"<<endl; cout<<"\nWARNING : BRepClass3d_SolidExplorer.cxx (Solid without face)"<<endl;
} }
#endif #endif
@ -753,7 +753,7 @@ void BRepClass3d_SolidExplorer::InitShape(const TopoDS_Shape& S)
//Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& P) const //Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& P) const
Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& ) const Standard_Boolean BRepClass3d_SolidExplorer::Reject(const gp_Pnt& ) const
{ {
return(myReject); // cas de solide sans face return(myReject); // case of solid without face
} }
//======================================================================= //=======================================================================
@ -919,6 +919,6 @@ void BRepClass3d_SolidExplorer::DumpSegment(const gp_Pnt&,
const TopAbs_State) const const TopAbs_State) const
{ {
#ifdef DEB #ifdef DEB
// rien pour le moment.
#endif #endif
} }

View File

@ -66,7 +66,7 @@ static void Descendants(const TopoDS_Shape&,
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : reconstruction topologique du resultat //purpose : topological reconstruction of the result
//======================================================================= //=======================================================================
void BRepFeat_Form::GlobalPerform () void BRepFeat_Form::GlobalPerform ()
{ {
@ -111,7 +111,7 @@ static void Descendants(const TopoDS_Shape&,
Standard_Boolean ChangeOpe = Standard_False; Standard_Boolean ChangeOpe = Standard_False;
//--- Ajout Shape From et Until dans la map pour ne pas les mettre dans LShape //--- Add Shape From and Until in the map to avoid setting them in LShape
Standard_Boolean FromInShape = Standard_False; Standard_Boolean FromInShape = Standard_False;
Standard_Boolean UntilInShape = Standard_False; Standard_Boolean UntilInShape = Standard_False;
TopTools_MapOfShape M; TopTools_MapOfShape M;
@ -163,14 +163,14 @@ static void Descendants(const TopoDS_Shape&,
} }
//--- Ajout Faces de collage dans la map pour ne pas les mettre dans LShape //--- Add Faces of glueing in the map to avoid setting them in LShape
TopTools_DataMapIteratorOfDataMapOfShapeShape itm; TopTools_DataMapIteratorOfDataMapOfShapeShape itm;
for (itm.Initialize(myGluedF);itm.More();itm.Next()) { for (itm.Initialize(myGluedF);itm.More();itm.Next()) {
M.Add(itm.Value()); M.Add(itm.Value());
} }
//--- Recherche de la liste LShape des faces concernees par la feature //--- Find in the list LShape faces concerned by the feature
TopTools_ListOfShape LShape; TopTools_ListOfShape LShape;
TopTools_ListIteratorOfListOfShape it,it2; TopTools_ListIteratorOfListOfShape it,it2;
@ -201,22 +201,22 @@ static void Descendants(const TopoDS_Shape&,
IntList.Clear(); IntList.Clear();
//--- 1) par intersection //--- 1) by intersection
// Intersection Outil Shape From // Intersection Tool Shape From
if (!mySFrom.IsNull()) { if (!mySFrom.IsNull()) {
ASI1.Init(mySFrom); ASI1.Init(mySFrom);
ASI1.Perform(scur); ASI1.Perform(scur);
} }
// Intersection Outil Shape Until // Intersection Tool Shape Until
if (!mySUntil.IsNull()) { if (!mySUntil.IsNull()) {
ASI2.Init(mySUntil); ASI2.Init(mySUntil);
ASI2.Perform(scur); ASI2.Perform(scur);
} }
#ifndef VREF #ifndef VREF
// Intersection Outil Shape de base // Intersection Tool base Shape
if (!ASI3.IsDone()) { if (!ASI3.IsDone()) {
theOpe = 2; theOpe = 2;
LShape.Clear(); LShape.Clear();
@ -224,7 +224,7 @@ static void Descendants(const TopoDS_Shape&,
else else
#endif #endif
{ {
// Determination sens,locmin,locmax,FFrom,FUntil // Find sens, locmin, locmax, FFrom, FUntil
tempo=0; tempo=0;
locmin = RealFirst(); locmin = RealFirst();
locmax = RealLast(); locmax = RealLast();
@ -247,7 +247,7 @@ static void Descendants(const TopoDS_Shape&,
} }
else { else {
Standard_Integer ku, kf; Standard_Integer ku, kf;
if (! (mu > Mf || mf > Mu)) { //chevauchement des intervales if (! (mu > Mf || mf > Mu)) { //overlapping intervals
sens = 1; sens = 1;
kf = 1; kf = 1;
ku = ASI2.NbPoints(jj); ku = ASI2.NbPoints(jj);
@ -304,8 +304,8 @@ static void Descendants(const TopoDS_Shape&,
if (ASI2.NbPoints(jj) <= 0) if (ASI2.NbPoints(jj) <= 0)
continue; continue;
// pour cas base prism a cheval sur mySUntil -> sens ambigu // for base case prism on mySUntil -> ambivalent direction
// -> on privilegie sens = 1 // -> preferrable direction = 1
if(sens != 1) { if(sens != 1) {
if (ASI2.Point(jj,1).Parameter()* if (ASI2.Point(jj,1).Parameter()*
ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter()<=0) ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter()<=0)
@ -346,9 +346,9 @@ static void Descendants(const TopoDS_Shape&,
} }
// Mise a jour LShape par ajout des faces du Shape de base // Update LShape by adding faces of the base Shape
// qui sont OK pour (sens, locmin et locmax) // that are OK (sens, locmin and locmax)
// qui ne sont pas deja dans la map (Shape From Until et faces collage) // that are not yet in the map (Shape From Until and glue faces)
#ifndef VREF #ifndef VREF
if (theOpe == 2) { if (theOpe == 2) {
for (Standard_Integer i=1; i<=ASI3.NbPoints(jj); i++) { for (Standard_Integer i=1; i<=ASI3.NbPoints(jj); i++) {
@ -399,7 +399,7 @@ static void Descendants(const TopoDS_Shape&,
#ifndef VREF #ifndef VREF
//--- 2) par section avec la boite englobante //--- 2) by section with the bounding box
Bnd_Box prbox; Bnd_Box prbox;
BRepBndLib::Add(myGShape,prbox); BRepBndLib::Add(myGShape,prbox);
@ -421,14 +421,14 @@ static void Descendants(const TopoDS_Shape&,
Standard_Integer counter = 0; Standard_Integer counter = 0;
// On ne traite pas : la face de collage // Are not processed: the face of gluing
// les faces du Shape From // the faces of Shape From
// les faces du Shape Until // the faces of Shape Until
// les faces deja dans LShape // the faces already in LShape
// les faces de myGluedF // the faces of myGluedF
// Si la face n'a pas ete eliminee ... on la garde si boite enblobante // If the face was not eliminated ... it is preserved if bounding box
// est en collision avec celle de myGShape = outil // collides with the box of myGShape = outil
// ou celle des faces limites (mySFrom mySUntil mySkface) // or the box of limit faces (mySFrom mySUntil mySkface)
for(; exx1.More(); exx1.Next()) { for(; exx1.More(); exx1.Next()) {
const TopoDS_Face& sh = TopoDS::Face(exx1.Current()); const TopoDS_Face& sh = TopoDS::Face(exx1.Current());
counter++; counter++;
@ -479,8 +479,8 @@ static void Descendants(const TopoDS_Shape&,
#endif #endif
#ifdef VREF #ifdef VREF
// test de performance : ajout de toutes les faces du Shape de base dans LShape // test of performance : add all faces of the base Shape in LShape
// (pas de phase de tri mais plus de faces) -> pas concluant // (no phase of parsing, but more faces) -> no concluant
TopExp_Explorer exx1; TopExp_Explorer exx1;
for (exx1.Init(mySbase, TopAbs_FACE); for (exx1.Init(mySbase, TopAbs_FACE);
exx1.More(); exx1.Next()) { exx1.More(); exx1.Next()) {
@ -494,14 +494,14 @@ static void Descendants(const TopoDS_Shape&,
LocOpe_Gluer theGlue; LocOpe_Gluer theGlue;
//--- cas de collage //--- case of gluing
if (theOpe == 1) { if (theOpe == 1) {
#ifdef DEB #ifdef DEB
if (trc) cout << " Gluer" << endl; if (trc) cout << " Gluer" << endl;
#endif #endif
Standard_Boolean Collage = Standard_True; Standard_Boolean Collage = Standard_True;
// on coupe par FFrom && FUntil // cut by FFrom && FUntil
TopoDS_Shape Comp; TopoDS_Shape Comp;
BRep_Builder B; BRep_Builder B;
B.MakeCompound(TopoDS::Compound(Comp)); B.MakeCompound(TopoDS::Compound(Comp));
@ -533,7 +533,7 @@ static void Descendants(const TopoDS_Shape&,
Collage = Standard_False; Collage = Standard_False;
} }
else {// else X0 else {// else X0
// On ne garde que les solides // Only solids are preserved
TopoDS_Shape theGShape; TopoDS_Shape theGShape;
BRep_Builder B; BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape)); B.MakeCompound(TopoDS::Compound(theGShape));
@ -662,7 +662,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
// On rajoute le collage sur face de depart et fin , si necessaire !!! // Add gluing on start and end face if necessary !!!
if (FromInShape && Collage) { if (FromInShape && Collage) {
TopExp_Explorer ex(mySFrom,TopAbs_FACE); TopExp_Explorer ex(mySFrom,TopAbs_FACE);
for(; ex.More(); ex.Next()) { for(; ex.More(); ex.Next()) {
@ -693,8 +693,8 @@ static void Descendants(const TopoDS_Shape&,
theGlue.Bind(theFE.EdgeFrom(),theFE.EdgeTo()); theGlue.Bind(theFE.EdgeFrom(),theFE.EdgeTo());
} }
} }
//myMap.UnBind(fac2); // pour ne pas avoir fac2 dans la Map quand //myMap.UnBind(fac2); // to avoid fac2 in Map when
// on .appelle UpdateDescendants(theGlue) // UpdateDescendants(theGlue) is called
} }
} }
@ -708,7 +708,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
//--- si le collage est toujours applicable //--- if the gluing is always applicable
if (theOpe == 1) { if (theOpe == 1) {
#ifdef DEB #ifdef DEB
@ -842,7 +842,7 @@ static void Descendants(const TopoDS_Shape&,
} }
//--- cas sans collage + Outil aux bonnes dimensions //--- case without gluing + Tool with proper dimensions
if (theOpe == 2 && ChangeOpe && myJustGluer) { if (theOpe == 2 && ChangeOpe && myJustGluer) {
#ifdef DEB #ifdef DEB
@ -854,7 +854,7 @@ static void Descendants(const TopoDS_Shape&,
// return; // return;
} }
//--- cas sans collage //--- case without gluing
if (theOpe == 2) { if (theOpe == 2) {
#ifdef DEB #ifdef DEB
@ -863,7 +863,7 @@ static void Descendants(const TopoDS_Shape&,
TopoDS_Shape theGShape = myGShape; TopoDS_Shape theGShape = myGShape;
if (ChangeOpe) { if (ChangeOpe) {
#ifdef DEB #ifdef DEB
if (trc) cout << " Passage en ope. topologique" << endl; if (trc) cout << " Passage to topological operations" << endl;
#endif #endif
for (itm.Initialize(myGluedF); itm.More();itm.Next()) { for (itm.Initialize(myGluedF); itm.More();itm.Next()) {
const TopoDS_Face& fac = TopoDS::Face(itm.Value()); const TopoDS_Face& fac = TopoDS::Face(itm.Value());
@ -877,7 +877,7 @@ static void Descendants(const TopoDS_Shape&,
if(found) break; if(found) break;
} }
if(!found) { if(!found) {
// echec collage -> on remet les faces de collage dans LShape // failed gluing -> reset faces of gluing in LShape
LShape.Append(fac); LShape.Append(fac);
} }
} }
@ -911,7 +911,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
// mise a jour type de selection // update type of selection
if(myPerfSelection == BRepFeat_SelectionU && !UntilInShape) { if(myPerfSelection == BRepFeat_SelectionU && !UntilInShape) {
myPerfSelection = BRepFeat_NoSelection; myPerfSelection = BRepFeat_NoSelection;
} }
@ -930,14 +930,14 @@ static void Descendants(const TopoDS_Shape&,
//BRepAlgo_Cut trP(myGShape,Comp); //BRepAlgo_Cut trP(myGShape,Comp);
BRepAlgoAPI_Cut trP(myGShape, Comp); BRepAlgoAPI_Cut trP(myGShape, Comp);
//modified by NIZNHY-PKV Thu Mar 21 17:24:56 2002 t //modified by NIZNHY-PKV Thu Mar 21 17:24:56 2002 t
// le resultat est necessairement un compound. // the result is necessarily a compound.
exp.Init(trP.Shape(),TopAbs_SOLID); exp.Init(trP.Shape(),TopAbs_SOLID);
if (!exp.More()) { if (!exp.More()) {
myStatusError = BRepFeat_EmptyCutResult; myStatusError = BRepFeat_EmptyCutResult;
NotDone(); NotDone();
return; return;
} }
// On ne garde que les solides // Only solids are preserved
theGShape.Nullify(); theGShape.Nullify();
BRep_Builder B; BRep_Builder B;
B.MakeCompound(TopoDS::Compound(theGShape)); B.MakeCompound(TopoDS::Compound(theGShape));
@ -1063,7 +1063,7 @@ static void Descendants(const TopoDS_Shape&,
} }
//--- generation de "just feature" pour assemblage = Parties d'outil //--- generation of "just feature" for assembly = Parts of tool
TopTools_ListOfShape lshape; TopTools_ListOfShape lshape;
LocOpe_Builder theTOpe; LocOpe_Builder theTOpe;
Standard_Real pbmin, pbmax, prmin, prmax; Standard_Real pbmin, pbmax, prmin, prmax;
@ -1082,9 +1082,9 @@ static void Descendants(const TopoDS_Shape&,
theTOpe.PerformResult(); theTOpe.PerformResult();
if (theTOpe.IsDone()) { if (theTOpe.IsDone()) {
myShape = theTOpe.ResultingShape(); myShape = theTOpe.ResultingShape();
// UpdateDescendants(theTOpe.Builder(),myShape); // a priori bug de mise a jour // UpdateDescendants(theTOpe.Builder(),myShape); // a priori bug of update
UpdateDescendants(theTOpe.History(),myShape); // a priori bug de mise a jour UpdateDescendants(theTOpe.History(),myShape); // a priori bug of update
// a faire apres selection des parties a garder // to be done after selection of parts to be preserved
myNewEdges = theTOpe.Edges(); myNewEdges = theTOpe.Edges();
myTgtEdges = theTOpe.TgtEdges(); myTgtEdges = theTOpe.TgtEdges();
TopExp_Explorer explo(theTOpe.ResultingShape(), TopAbs_SOLID); TopExp_Explorer explo(theTOpe.ResultingShape(), TopAbs_SOLID);
@ -1099,12 +1099,12 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
//--- Selection des morceaux d'outil a garder //--- Selection of pieces of tool to be preserved
TopoDS_Solid thePartsOfTool; TopoDS_Solid thePartsOfTool;
if(!lshape.IsEmpty() && myPerfSelection != BRepFeat_NoSelection) { if(!lshape.IsEmpty() && myPerfSelection != BRepFeat_NoSelection) {
//Recherche ParametricMinMax en fonction contraintes des Shape From et Until // Find ParametricMinMax depending on the constraints of Shape From and Until
// -> prmin, prmax, pbmin et pbmax // -> prmin, prmax, pbmin and pbmax
C = BarycCurve(); C = BarycCurve();
if (C.IsNull()) { if (C.IsNull()) {
myStatusError = BRepFeat_EmptyBaryCurve; myStatusError = BRepFeat_EmptyBaryCurve;
@ -1125,7 +1125,7 @@ static void Descendants(const TopoDS_Shape&,
BRepFeat::ParametricMinMax(mySUntil,C, BRepFeat::ParametricMinMax(mySUntil,C,
prmin2, prmax2, prbmin2, prbmax2, flag1); prmin2, prmax2, prbmin2, prbmax2, flag1);
// cas des revol // case of revolutions
if (C->IsPeriodic()) { if (C->IsPeriodic()) {
Standard_Real period = C->Period(); Standard_Real period = C->Period();
prmax = prmax2; prmax = prmax2;
@ -1182,8 +1182,7 @@ static void Descendants(const TopoDS_Shape&,
return; return;
} }
// On cherche les parties de l`outil contenant les descendants du // Find parts of the tool containing descendants of Shape Until
// Shape Until
BRepFeat::ParametricMinMax(mySUntil,C, BRepFeat::ParametricMinMax(mySUntil,C,
prmin1, prmax1, prbmin1, prbmax1, flag1); prmin1, prmax1, prbmin1, prbmax1, flag1);
if (sens == 1) { if (sens == 1) {
@ -1201,15 +1200,15 @@ static void Descendants(const TopoDS_Shape&,
} }
// Choix plus fin des ParametricMinMax dans le cas ou l'outil // Finer choice of ParametricMinMax in case when the tool
// intersecte les Shapes From et Until // intersects Shapes From and Until
// cas de plusieurs intersections (retenir PartsOfTool en accord avec selection) // case of several intersections (keep PartsOfTool according to the selection)
// position de la face d`intersection dans PartsOfTool (avant ou arriere) // position of the face of intersection in PartsOfTool (before or after)
Standard_Real delta = Precision::Confusion(); Standard_Real delta = Precision::Confusion();
if (myPerfSelection != BRepFeat_NoSelection) { if (myPerfSelection != BRepFeat_NoSelection) {
// modif du test pour cts21181 : (prbmax2 et prnmin2) -> (prbmin1 et prbmax1) // modif of the test for cts21181 : (prbmax2 and prnmin2) -> (prbmin1 and prbmax1)
// correction prise en compte de flag2 pour pro15323 et de flag3 pour pro16060 // correction take into account flag2 for pro15323 and flag3 for pro16060
if (!mySUntil.IsNull()) { if (!mySUntil.IsNull()) {
TopTools_MapOfShape mapFuntil; TopTools_MapOfShape mapFuntil;
Descendants(mySUntil,theTOpe,mapFuntil); Descendants(mySUntil,theTOpe,mapFuntil);
@ -1335,7 +1334,7 @@ static void Descendants(const TopoDS_Shape&,
} }
// Tri des PartsOfTool a garder ou non en fonction des ParametricMinMax // Parse PartsOfTool to preserve or not depending on ParametricMinMax
if (!myJustFeat) { if (!myJustFeat) {
Standard_Boolean KeepParts = Standard_False; Standard_Boolean KeepParts = Standard_False;
BRep_Builder BB; BRep_Builder BB;
@ -1384,7 +1383,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
// Cas ou on ne garde aucune partie d`outil // Case when no part of the tool is preserved
if (!KeepParts) { if (!KeepParts) {
#ifdef DEB #ifdef DEB
if (trc) cout << " No parts of tool kept" << endl; if (trc) cout << " No parts of tool kept" << endl;
@ -1395,7 +1394,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
else { else {
// cas JustFeature -> on garde tous les PartsOfTool // case JustFeature -> all PartsOfTool are preserved
Standard_Real prmin1, prmax1, prbmin1, prbmax1; Standard_Real prmin1, prmax1, prbmin1, prbmax1;
Standard_Real min, max, pmin, pmax; Standard_Real min, max, pmin, pmax;
Standard_Boolean flag2; Standard_Boolean flag2;
@ -1429,11 +1428,11 @@ static void Descendants(const TopoDS_Shape&,
} }
//--- Generation du resultat myShape //--- Generation of result myShape
if (!myJustFeat) { if (!myJustFeat) {
// suppression des edges de section qui n'ont aucun vertex commun // removal of edges of section that have no common vertices
// avec les PartsOfTool converves // with PartsOfTool preserved
theTOpe.PerformResult(); theTOpe.PerformResult();
if (theTOpe.IsDone()) { if (theTOpe.IsDone()) {
Done(); Done();
@ -1441,7 +1440,7 @@ static void Descendants(const TopoDS_Shape&,
// //
BRepLib::SameParameter(myShape, 1.e-7, Standard_True); BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
// //
// mise a jour des new et tangent edges // update new and tangent edges
// UpdateDescendants(theTOpe.Builder(),myShape); // UpdateDescendants(theTOpe.Builder(),myShape);
UpdateDescendants(theTOpe.History(),myShape); UpdateDescendants(theTOpe.History(),myShape);
myNewEdges = theTOpe.Edges(); myNewEdges = theTOpe.Edges();
@ -1450,7 +1449,7 @@ static void Descendants(const TopoDS_Shape&,
} }
// else myTgtEdges.Clear(); // else myTgtEdges.Clear();
} }
else {// dernier recours (attention new et tangent edges) else {// last recourse (attention new and tangent edges)
if (!thePartsOfTool.IsNull()) { if (!thePartsOfTool.IsNull()) {
#ifdef DEB #ifdef DEB
if (trc) cout << " Parts of Tool : direct Ope. Top." << endl; if (trc) cout << " Parts of Tool : direct Ope. Top." << endl;
@ -1493,7 +1492,7 @@ static void Descendants(const TopoDS_Shape&,
} }
} }
else { else {
// tout est deja fait // all is already done
Done(); Done();
} }
} }
@ -1523,7 +1522,7 @@ const TopTools_ListOfShape& BRepFeat_Form::Modified
{ {
if (myMap.IsBound(F)) { if (myMap.IsBound(F)) {
static TopTools_ListOfShape list; static TopTools_ListOfShape list;
list.Clear(); // Pour le second passage DPF list.Clear(); // For the second passage DPF
TopTools_ListIteratorOfListOfShape ite(myMap(F)); TopTools_ListIteratorOfListOfShape ite(myMap(F));
for(; ite.More(); ite.Next()) { for(; ite.More(); ite.Next()) {
const TopoDS_Shape& sh = ite.Value(); const TopoDS_Shape& sh = ite.Value();
@ -1544,9 +1543,9 @@ const TopTools_ListOfShape& BRepFeat_Form::Generated
(const TopoDS_Shape& S) (const TopoDS_Shape& S)
{ {
if (myMap.IsBound(S) && if (myMap.IsBound(S) &&
S.ShapeType() != TopAbs_FACE) { // voir si on filtre sur face ou pas S.ShapeType() != TopAbs_FACE) { // check if filter on face or not
static TopTools_ListOfShape list; static TopTools_ListOfShape list;
list.Clear(); // Pour le second passage DPF list.Clear(); // For the second passage DPF
TopTools_ListIteratorOfListOfShape ite(myMap(S)); TopTools_ListIteratorOfListOfShape ite(myMap(S));
for(; ite.More(); ite.Next()) { for(; ite.More(); ite.Next()) {
const TopoDS_Shape& sh = ite.Value(); const TopoDS_Shape& sh = ite.Value();
@ -1644,7 +1643,7 @@ const TopTools_ListOfShape& BRepFeat_Form::TgtEdges() const
//======================================================================= //=======================================================================
//function : TransformSUntil //function : TransformSUntil
//purpose : Limitation du shape until dans le cas des faces infinies //purpose : Limitation of the shape until the case of infinite faces
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag) Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
@ -1663,7 +1662,7 @@ Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
return Trf; return Trf;
TopExp_Explorer exp(shapefu, TopAbs_FACE); TopExp_Explorer exp(shapefu, TopAbs_FACE);
if (!exp.More()) { // pas de faces... Il faudrait renvoyer une erreur if (!exp.More()) { // no faces... It is necessary to return an error
#ifdef DEB #ifdef DEB
if (trc) cout << " BRepFeat_Form::TransformShapeFU : invalid Shape" << endl; if (trc) cout << " BRepFeat_Form::TransformShapeFU : invalid Shape" << endl;
#endif #endif
@ -1671,7 +1670,7 @@ Standard_Boolean BRepFeat_Form::TransformShapeFU(const Standard_Integer flag)
} }
exp.Next(); exp.Next();
if (!exp.More()) { // une seule face. Est-elle infinie?? if (!exp.More()) { // the only face. Is it infinite?
exp.ReInit(); exp.ReInit();
TopoDS_Face fac = TopoDS::Face(exp.Current()); TopoDS_Face fac = TopoDS::Face(exp.Current());
@ -1895,7 +1894,7 @@ static void Descendants(const TopoDS_Shape& S,
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the appartenance to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
// const TopoDS_Shape& sh = itm.Key(); // const TopoDS_Shape& sh = itm.Key();
@ -1952,7 +1951,7 @@ static void Descendants(const TopoDS_Shape& S,
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the appartenance to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
// const TopoDS_Shape& sh = itm.Key(); // const TopoDS_Shape& sh = itm.Key();
@ -2008,7 +2007,7 @@ static void Descendants(const TopoDS_Shape& S,
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the appartenance to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
// const TopoDS_Shape& sh = itm.Key(); // const TopoDS_Shape& sh = itm.Key();

View File

@ -64,7 +64,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
theList.Append(theASI.Point(i).Face()); theList.Append(theASI.Point(i).Face());
} }
// On ne peut pas utiliser de cylindre infini pour les ope topologiques... // It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax; Standard_Real PMin,PMax;
BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax); BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin); Standard_Real Heigth = 2.*(PMax-PMin);
@ -75,7 +75,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius)
Radius, Radius,
Heigth); Heigth);
// Peut-etre vaudrait-il mieux faire directement une coupe // Probably it is better to make cut directly
BRep_Builder B; BRep_Builder B;
TopoDS_Solid theTool; TopoDS_Solid theTool;
@ -164,7 +164,7 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
} }
} }
// On ne peut pas utiliser de cylindre infini pour les ope topologiques... // It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax; Standard_Real PMin,PMax;
BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax); BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin); Standard_Real Heigth = 2.*(PMax-PMin);
@ -200,8 +200,8 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
return; return;
} }
if (nbparts >= 2) { // on garde la plus petite en parametre if (nbparts >= 2) { // preserve the smallest as parameter
// le long de l`axe // along the axis
TopoDS_Shape tokeep; TopoDS_Shape tokeep;
Standard_Real parbar,parmin = Last; Standard_Real parbar,parmin = Last;
gp_Pnt Barycentre; gp_Pnt Barycentre;
@ -214,7 +214,7 @@ void BRepFeat_MakeCylindricalHole::PerformThruNext(const Standard_Real Radius,
} }
} }
if (tokeep.IsNull()) { // on garde le plus proche de l`intervalle if (tokeep.IsNull()) { // preserve the closest interval
Standard_Real dmin = RealLast(); Standard_Real dmin = RealLast();
for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) { for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) {
@ -273,8 +273,8 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
if (ok) { if (ok) {
if (theOr == TopAbs_REVERSED) { if (theOr == TopAbs_REVERSED) {
ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // on remonte ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // on reset
// On pourrait aller chercher la suivante... // It is possible to search for the next.
} }
if ( ok && theOr == TopAbs_FORWARD) { if ( ok && theOr == TopAbs_FORWARD) {
First = theASI.Point(IndFrom).Parameter(); First = theASI.Point(IndFrom).Parameter();
@ -305,7 +305,7 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
} }
} }
// On ne peut pas utiliser de cylindre infini pour les ope topologiques... // It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax; Standard_Real PMin,PMax;
BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax); BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin); Standard_Real Heigth = 2.*(PMax-PMin);
@ -341,7 +341,7 @@ void BRepFeat_MakeCylindricalHole::PerformUntilEnd(const Standard_Real Radius,
return; return;
} }
if (nbparts >= 2) { // on garde tout ce qui est au dessus de First if (nbparts >= 2) { // preserve everything above the First
Standard_Real parbar; Standard_Real parbar;
gp_Pnt Barycentre; gp_Pnt Barycentre;
for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) { for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) {
@ -397,8 +397,8 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
Standard_Boolean ok = theASI.LocalizeAfter(thePFrom,theOr,IndFrom,IndTo); Standard_Boolean ok = theASI.LocalizeAfter(thePFrom,theOr,IndFrom,IndTo);
if (ok) { if (ok) {
if (theOr == TopAbs_REVERSED) { if (theOr == TopAbs_REVERSED) {
ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // on remonte ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // reset
// On pourrait aller chercher la suivante... // It is possible to find the next.
} }
if ( ok && theOr == TopAbs_FORWARD) { if ( ok && theOr == TopAbs_FORWARD) {
First = theASI.Point(IndFrom).Parameter(); First = theASI.Point(IndFrom).Parameter();
@ -430,7 +430,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
} }
} }
// On ne peut pas utiliser de cylindre infini pour les ope topologiques... // // It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax; Standard_Real PMin,PMax;
BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax); BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax);
Standard_Real Heigth = 2.*(PMax-PMin); Standard_Real Heigth = 2.*(PMax-PMin);
@ -467,7 +467,7 @@ void BRepFeat_MakeCylindricalHole::Perform(const Standard_Real Radius,
return; return;
} }
if (nbparts >= 2) { // on garde les parties entre First et Last if (nbparts >= 2) { // preserve parts between First and Last
TopoDS_Shape tokeep; TopoDS_Shape tokeep;
Standard_Real parbar; Standard_Real parbar;
@ -516,8 +516,8 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
if (ok) { if (ok) {
if (theOr == TopAbs_REVERSED) { if (theOr == TopAbs_REVERSED) {
ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // on remonte ok = theASI.LocalizeBefore(IndFrom,theOr,IndFrom,IndTo); // reset
// on pourrait aller chercher la suivante... // it is possible to find the next
} }
ok = ok && theOr == TopAbs_FORWARD; ok = ok && theOr == TopAbs_FORWARD;
} }
@ -526,7 +526,7 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
return; return;
} }
// on verifie a priori la longueur du trou // check a priori the length of the hole
Standard_Integer IFNext,ITNext; Standard_Integer IFNext,ITNext;
ok = theASI.LocalizeAfter(IndTo,theOr,IFNext,ITNext); ok = theASI.LocalizeAfter(IndTo,theOr,IFNext,ITNext);
if (!ok) { if (!ok) {
@ -544,14 +544,14 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
theList.Append(theASI.Point(i).Face()); theList.Append(theASI.Point(i).Face());
} }
*/ */
// version pour plus de controle // version for advanced control
for (Standard_Integer i=IndFrom; i<= ITNext; i++) { for (Standard_Integer i=IndFrom; i<= ITNext; i++) {
theList.Append(theASI.Point(i).Face()); theList.Append(theASI.Point(i).Face());
} }
First = theASI.Point(IndFrom).Parameter(); First = theASI.Point(IndFrom).Parameter();
// On ne peut pas utiliser de cylindre infini pour les ope topologiques... //// It is not possible to use infinite cylinder for topological operations.
Standard_Real PMin,PMax; Standard_Real PMin,PMax;
BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax); BoxParameters(myBuilder.OriginalShape(),myAxis,PMin,PMax);
if (PMin > Length) { if (PMin > Length) {
@ -592,8 +592,7 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
return; return;
} }
if (nbparts >= 2) { // on garde la plus petite en parametre if (nbparts >= 2) { // preserve the smallest as parameter along the axis
// le long de l`axe
TopoDS_Shape tokeep; TopoDS_Shape tokeep;
Standard_Real parbar,parmin = RealLast(); Standard_Real parbar,parmin = RealLast();
gp_Pnt Barycentre; gp_Pnt Barycentre;
@ -606,7 +605,7 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius,
} }
} }
if (tokeep.IsNull()) { // on garde le plus proche de l`intervalle if (tokeep.IsNull()) { // preserve the closest interval
Standard_Real dmin = RealLast(); Standard_Real dmin = RealLast();
for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) { for (its.Initialize(myBuilder.PartsOfTool()); its.More(); its.Next()) {
@ -675,7 +674,7 @@ BRepFeat_Status BRepFeat_MakeCylindricalHole::Validate ()
{ {
BRepFeat_Status thestat = BRepFeat_NoError; BRepFeat_Status thestat = BRepFeat_NoError;
TopExp_Explorer ex(myBuilder.ResultingShape(),TopAbs_FACE); TopExp_Explorer ex(myBuilder.ResultingShape(),TopAbs_FACE);
if (myIsBlind) { // trou borgne if (myIsBlind) { // limit of the hole
for (; ex.More(); ex.Next()) { for (; ex.More(); ex.Next()) {
if (ex.Current().IsSame(myTopFace) ) { if (ex.Current().IsSame(myTopFace) ) {
break; break;
@ -712,7 +711,7 @@ void Baryc(const TopoDS_Shape& S, gp_Pnt& B)
Standard_Integer i, nbp= 0; Standard_Integer i, nbp= 0;
for (; exp.More(); exp.Next()) { for (; exp.More(); exp.Next()) {
// On calcule 11 points par edges no degenerees // Calculate points by non-degenerated edges
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
if (!BRep_Tool::Degenerated(E)) { if (!BRep_Tool::Degenerated(E)) {
C = BRep_Tool::Curve(E,L,First,Last); C = BRep_Tool::Curve(E,L,First,Last);
@ -735,7 +734,7 @@ void BoxParameters(const TopoDS_Shape& S,
Standard_Real& parmax) Standard_Real& parmax)
{ {
// calcul des parametres d`une boite englobante selon l`axe du trou // calculate the parameters of a bounding box in the direction of the axis of the hole
Bnd_Box B; Bnd_Box B;
BRepBndLib::Add(S,B); BRepBndLib::Add(S,B);
Standard_Real c[6]; Standard_Real c[6];

View File

@ -181,7 +181,7 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape& Sbase,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : add faces et edges de glissement //purpose : add sliding faces and edges
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E, void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
@ -228,7 +228,7 @@ void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : feature de la hauteur Height //purpose : feature of Height
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::Perform(const Standard_Real Height) void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
@ -296,20 +296,20 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
} }
} }
// gestion des faces de collage // management of gluing faces
//SetGluedFaces(mySkface, mySbase, theBase, mySlface, theDPrism, myGluedF); //SetGluedFaces(mySkface, mySbase, theBase, mySlface, theDPrism, myGluedF);
GluedFacesValid(); GluedFacesValid();
// VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theDPrism, myGluedF); // VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theDPrism, myGluedF);
if(!myGluedF.IsEmpty()) { // cas collage if(!myGluedF.IsEmpty()) { // case gluing
myJustGluer = Standard_True; myJustGluer = Standard_True;
theDPrism.Curves(myCurves); theDPrism.Curves(myCurves);
myBCurve = theDPrism.BarycCurve(); myBCurve = theDPrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
// si il n'y a pas de collage -> appel des ope topo // if there is no gluing -> call topological operations
if(!myJustGluer) { if(!myJustGluer) {
if(myFuse == 1) { if(myFuse == 1) {
//modified by NIZNHY-PKV Thu Mar 21 17:32:17 2002 f //modified by NIZNHY-PKV Thu Mar 21 17:32:17 2002 f
@ -342,7 +342,7 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : feature limitee par le shape Until //purpose : feature limited by the shape Until
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until) void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
@ -481,7 +481,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : feature limitee par les deux shapes //purpose : feature limited by two shapes
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From, void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
@ -550,22 +550,22 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
if(!Trff) { if(!Trff) {
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
// On fait systematiquement le dprism // Make systematically dprism
myGShape = VraiDPrism; myGShape = VraiDPrism;
GeneratedShapeValid(); GeneratedShapeValid();
// gestion des faces de collage // management of gluing faces
//SetGluedFaces(TopoDS_Face(), // on ne veut pas binder mySkface //SetGluedFaces(TopoDS_Face(), // on ne veut pas binder mySkface
// mySbase, myPbase, mySlface, theDPrism, myGluedF); // mySbase, myPbase, mySlface, theDPrism, myGluedF);
GluedFacesValid(); GluedFacesValid();
theDPrism.Curves(myCurves); theDPrism.Curves(myCurves);
myBCurve = theDPrism.BarycCurve(); myBCurve = theDPrism.BarycCurve();
// reconstruction topologique // topologic reconstruction
GlobalPerform(); GlobalPerform();
} }
else { else {
// gestion des descendants // management of descendants
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
Handle(Geom_Curve) C1; Handle(Geom_Curve) C1;
if(sens == -1) { if(sens == -1) {
@ -583,7 +583,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
ASI2.Perform(scur); ASI2.Perform(scur);
TopAbs_Orientation OrU, OrF; TopAbs_Orientation OrU, OrF;
TopoDS_Face FFrom, FUntil; TopoDS_Face FFrom, FUntil;
//sens du dprism //direction of dprism
if (ASI1.IsDone() && ASI1.NbPoints(1) >=1) { if (ASI1.IsDone() && ASI1.NbPoints(1) >=1) {
if (myFuse == 1) { if (myFuse == 1) {
OrU = ASI1.Point(1,1).Orientation(); OrU = ASI1.Point(1,1).Orientation();
@ -701,7 +701,7 @@ void BRepFeat_MakeDPrism::PerformUntilEnd()
//======================================================================= //=======================================================================
//function : PerformFromEnd //function : PerformFromEnd
//purpose : feature mi-infinie limitee par le shape Until de l'autre cote //purpose : feature semiinfinite limited by the shape Until from the other side
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until) void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
@ -743,7 +743,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
return; return;
} }
if(!Trf) { // cas face finie if(!Trf) { // case finite face
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
myGShape = VraiDPrism; myGShape = VraiDPrism;
GeneratedShapeValid(); GeneratedShapeValid();
@ -753,7 +753,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
myBCurve = theDPrism.BarycCurve(); myBCurve = theDPrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
else { // cas support else { // case support
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
Handle(Geom_Curve) C2; Handle(Geom_Curve) C2;
if(sens == -1) { if(sens == -1) {
@ -864,7 +864,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
//======================================================================= //=======================================================================
//function : PerformThruAll //function : PerformThruAll
//purpose : feature a travers tout le shape initial //purpose : feature throughout the entire initial shape
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::PerformThruAll() void BRepFeat_MakeDPrism::PerformThruAll()
@ -921,7 +921,7 @@ void BRepFeat_MakeDPrism::PerformThruAll()
//======================================================================= //=======================================================================
//function : PerformUntilHeight //function : PerformUntilHeight
//purpose : feature jusqu'un shape de la hauteur donnee //purpose : feature until the shape is of the given height
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until, void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
@ -956,7 +956,7 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
LocOpe_DPrism theDPrism(myPbase,sens*Height,myAngle); LocOpe_DPrism theDPrism(myPbase,sens*Height,myAngle);
TopoDS_Shape VraiDPrism = theDPrism.Shape(); TopoDS_Shape VraiDPrism = theDPrism.Shape();
if(!Trf) { // cas face finie if(!Trf) { // case face finished
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
myGShape = VraiDPrism; myGShape = VraiDPrism;
GeneratedShapeValid(); GeneratedShapeValid();
@ -978,7 +978,7 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
myBCurve = theDPrism.BarycCurve(); myBCurve = theDPrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
else { // cas support else { // case support
MajMap(myPbase,theDPrism,myMap,myFShape,myLShape); MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
Handle(Geom_Curve) C1; Handle(Geom_Curve) C1;
if(sens == -1) { if(sens == -1) {
@ -1045,7 +1045,7 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
//======================================================================= //=======================================================================
//function : Curves //function : Curves
//purpose : courbes paralleles a l'axe du prism //purpose : curves parallel to the axis of the prism
//======================================================================= //=======================================================================
void BRepFeat_MakeDPrism::Curves(TColGeom_SequenceOfCurve& scur) void BRepFeat_MakeDPrism::Curves(TColGeom_SequenceOfCurve& scur)
@ -1090,7 +1090,7 @@ void BRepFeat_MakeDPrism::BossEdges (const Standard_Integer signature)
// Edges Bottom // Edges Bottom
if (signature < 0) { if (signature < 0) {
// Attention voir si TgtEdges est important // Attention check if TgtEdges is important
myLatEdges = NewEdges(); myLatEdges = NewEdges();
} }
else if (signature > 0) { else if (signature > 0) {
@ -1180,7 +1180,7 @@ Handle(Geom_Curve) BRepFeat_MakeDPrism::BarycCurve()
//======================================================================= //=======================================================================
//function : HeightMax //function : HeightMax
//purpose : Calcul de la hauteur du prisme selon les parametres d`une boite englobante //purpose : Calculate the height of the prism following the parameters of the bounding box
//======================================================================= //=======================================================================
static Standard_Real HeightMax(const TopoDS_Shape& theSbase, // shape initial static Standard_Real HeightMax(const TopoDS_Shape& theSbase, // shape initial
@ -1224,7 +1224,7 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase, // shape initial
//======================================================================= //=======================================================================
//function : SensOfPrism //function : SensOfPrism
//purpose : determiner la direction de generation du prism //purpose : determine the direction of prism generation
//======================================================================= //=======================================================================
Standard_Integer SensOfPrism(const Handle(Geom_Curve) C, Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
const TopoDS_Shape& Until) const TopoDS_Shape& Until)
@ -1284,7 +1284,7 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
} }
} }
// Glissements // Sliding
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {
@ -1307,8 +1307,8 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : VerifGluedFaces //function : VerifGluedFaces
//purpose : Verification intersection Outil/theSkface = thePbase //purpose : Checking intersection Tool/theSkface = thePbase
// Si oui -> OK si non -> cas sans collage // if yes -> OK if no -> case without gluing
//======================================================================= //=======================================================================
#ifdef DEB #ifdef DEB
static void VerifGluedFaces(const TopoDS_Face& theSkface, static void VerifGluedFaces(const TopoDS_Face& theSkface,
@ -1360,7 +1360,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
if (!GluedFaces) { if (!GluedFaces) {
#ifdef DEB #ifdef DEB
Standard_Boolean trc = BRepFeat_GettraceFEAT(); Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << " Intersection DPrism/skface : pas de collage" << endl; if (trc) cout << " Intersection DPrism/skface : no gluing" << endl;
#endif #endif
theMap.Clear(); theMap.Clear();
} }
@ -1492,7 +1492,7 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
Standard_Boolean ValRet = Standard_False; Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // pour appliquer la location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());

View File

@ -139,8 +139,8 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
Done(); Done();
myGenerated.Clear(); myGenerated.Clear();
// modify = 0 si on ne veut pas faire de glissement // modify = 0 if there is no intention to make sliding
// = 1 si on veut essayer de faire un glissement // = 1 if one tries to make sliding
Standard_Boolean Sliding = Modify; Standard_Boolean Sliding = Modify;
myLFMap.Clear(); myLFMap.Clear();
@ -176,7 +176,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
#endif #endif
// ---Determination Tolerance : tolerance max sur les parametres // ---Determine Tolerance : max tolerance on parameters
myTol = Precision::Confusion(); myTol = Precision::Confusion();
TopExp_Explorer exx; TopExp_Explorer exx;
@ -194,8 +194,8 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
if(tol > myTol) myTol = tol; if(tol > myTol) myTol = tol;
} }
// ---Controle des directions // ---Control of directions
// le wire doit etre dans la nervure // the wire should be in the rib
gp_Vec nulldir(0, 0, 0); gp_Vec nulldir(0, 0, 0);
if(!myDir1.IsEqual(nulldir, myTol, myTol)) { if(!myDir1.IsEqual(nulldir, myTol, myTol)) {
Standard_Real ang = myDir1.Angle(myDir); Standard_Real ang = myDir1.Angle(myDir);
@ -225,7 +225,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
myPln->Transform(T); myPln->Transform(T);
} }
// ---Calcul boite englobante // ---Calculate bounding box
BRep_Builder BB; BRep_Builder BB;
TopTools_ListOfShape theList; TopTools_ListOfShape theList;
@ -240,7 +240,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Solid BndBox = Bndbox.Solid(); TopoDS_Solid BndBox = Bndbox.Solid();
// ---Construction de la face plan de travail (section boite englobante) // ---Construction of the face workplane (section bounding box)
BRepLib_MakeFace PlaneF(myPln->Pln(), -6.*myBnd, BRepLib_MakeFace PlaneF(myPln->Pln(), -6.*myBnd,
6.*myBnd, -6.*myBnd, 6.*myBnd); 6.*myBnd, -6.*myBnd, 6.*myBnd);
TopoDS_Face PlaneFace = TopoDS::Face(PlaneF.Shape()); TopoDS_Face PlaneFace = TopoDS::Face(PlaneF.Shape());
@ -257,7 +257,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Face BndFace = TopoDS::Face(Bndface.Shape()); TopoDS_Face BndFace = TopoDS::Face(Bndface.Shape());
// ---Recherche des faces d'appui de la nervure // ---Find support faces of the rib
TopoDS_Edge FirstEdge, LastEdge; TopoDS_Edge FirstEdge, LastEdge;
TopoDS_Face FirstFace, LastFace; TopoDS_Face FirstFace, LastFace;
TopoDS_Vertex FirstVertex, LastVertex; TopoDS_Vertex FirstVertex, LastVertex;
@ -286,23 +286,23 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Point detrompeur pour le cote du wire a remplir - cote matiere // ---Proofing Point for the side of the wire to be filled - side material
gp_Pnt CheckPnt = CheckPoint(FirstEdge, bnd/10., myPln); gp_Pnt CheckPnt = CheckPoint(FirstEdge, bnd/10., myPln);
// Standard_Real f, l; // Standard_Real f, l;
// ---Controle glissement valable // ---Control sliding valuable
// Plein de cas ou on sort du glissement // Many cases when the sliding is abandoned
Standard_Integer Concavite = 3; // a priori le profile n'est pas concave Standard_Integer Concavite = 3; // a priori the profile is not concave
myFirstPnt = BRep_Tool::Pnt(FirstVertex); myFirstPnt = BRep_Tool::Pnt(FirstVertex);
myLastPnt = BRep_Tool::Pnt(LastVertex); myLastPnt = BRep_Tool::Pnt(LastVertex);
// SliList : liste des faces concernees par la nervure // SliList : list of faces concerned by the rib
TopTools_ListOfShape SliList; TopTools_ListOfShape SliList;
SliList.Append(FirstFace); SliList.Append(FirstFace);
if(Sliding) { // glissement if(Sliding) { // sliding
#ifdef DEB #ifdef DEB
if (trc) cout << " Sliding" << endl; if (trc) cout << " Sliding" << endl;
#endif #endif
@ -315,15 +315,15 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
if(s->DynamicType() == STANDARD_TYPE(Geom_Plane) || if(s->DynamicType() == STANDARD_TYPE(Geom_Plane) ||
s->DynamicType() == STANDARD_TYPE(Geom_CylindricalSurface)) { s->DynamicType() == STANDARD_TYPE(Geom_CylindricalSurface)) {
// si plan ou cylindre : glissement possible // if plane or cylinder : sliding is possible
Sliding = Standard_True; Sliding = Standard_True;
} }
} }
// Controle uniquement points de depart et d'arrivee // Control only start and end points
// -> pas de controle au milieu - a ameliorer // -> no control at the middle - improve
// Si on faisait un controle entre Surface et sgement entre les 2 points limite // Controle between Surface and segment between 2 limit points
// -> tres cher - a ameliorer // is too expensive - improve
if(Sliding) { if(Sliding) {
gp_Pnt p1(myFirstPnt.X()+myDir.X(),myFirstPnt.Y()+myDir.Y(), gp_Pnt p1(myFirstPnt.X()+myDir.X(),myFirstPnt.Y()+myDir.Y(),
myFirstPnt.Z()+myDir.Z()); myFirstPnt.Z()+myDir.Z());
@ -333,7 +333,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
gp_Pnt p2(myLastPnt.X()+myDir.X(),myLastPnt.Y()+myDir.Y(), gp_Pnt p2(myLastPnt.X()+myDir.X(),myLastPnt.Y()+myDir.Y(),
myLastPnt.Z()+myDir.Z()); myLastPnt.Z()+myDir.Z());
BRepLib_MakeEdge ee2(myLastPnt, p2); BRepLib_MakeEdge ee2(myLastPnt, p2);
BRepExtrema_ExtCF ext2(ee2, LastFace); // ExtCF : courbes et surfaces BRepExtrema_ExtCF ext2(ee2, LastFace); // ExtCF : curves and surfaces
if(ext2.NbExt() == 1 && ext2.SquareDistance(1)<=BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace)) { if(ext2.NbExt() == 1 && ext2.SquareDistance(1)<=BRep_Tool::Tolerance(LastFace) * BRep_Tool::Tolerance(LastFace)) {
Sliding = Standard_True; Sliding = Standard_True;
} }
@ -371,13 +371,13 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// On construit un gros profil qui va jusqu`a la boite englobante // Construct a great profile that goes till the bounding box
// -> par tangence avec premier et dernier edge du Wire // -> by tangency with the first and the last edge of the Wire
// -> par normales aux faces d'appui : statistiquement meilleur // -> by normals to the support faces : statistically better
// On intersecte le tout pour trouver le profil final // Intersect everything to find the final profile
// ---cas de glissement : construction de la face profil // ---case of sliding : construction of the profile face
if(Sliding) { if(Sliding) {
#ifdef DEB #ifdef DEB
if (trc) cout << " still Sliding" << endl; if (trc) cout << " still Sliding" << endl;
@ -399,11 +399,11 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Propagation sur les faces du shape initial // ---Propagation on faces of the initial shape
// pour trouver les faces concernees par la nervure // to find the faces concerned by the rib
Standard_Boolean falseside = Standard_True; Standard_Boolean falseside = Standard_True;
Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
// Controle si on a ce qu`il faut pour avoir la matiere du bon cote // Control if there is everything required to have the material at the proper side
if(falseside == Standard_False) { if(falseside == Standard_False) {
#ifdef DEB #ifdef DEB
cout << "Verify plane and wire orientation" << endl; cout << "Verify plane and wire orientation" << endl;
@ -415,7 +415,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Generation du profile de base de la nervure // ---Generation of the base of the rib profile
TopoDS_Wire w; TopoDS_Wire w;
BB.MakeWire(w); BB.MakeWire(w);
@ -423,10 +423,10 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Vertex theFV; TopoDS_Vertex theFV;
thePreviousEdge.Nullify(); thePreviousEdge.Nullify();
// compteur du nombre d`edges pour remplir la map // calculate the number of edges to fill the map
Standard_Integer counter = 1; Standard_Integer counter = 1;
// ---cas de glissement // ---case of sliding
if(Sliding && !myListOfEdges.IsEmpty()) { if(Sliding && !myListOfEdges.IsEmpty()) {
BRepTools_WireExplorer EX1(myWire); BRepTools_WireExplorer EX1(myWire);
for(; EX1.More(); EX1.Next()) { for(; EX1.More(); EX1.Next()) {
@ -480,7 +480,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
} }
// Cas plusieurs edges // Case of several edges
if(!FirstEdge.IsSame(LastEdge)) { if(!FirstEdge.IsSame(LastEdge)) {
for(; EX1.More(); EX1.Next()) { for(; EX1.More(); EX1.Next()) {
const TopoDS_Edge& E = EX1.Current(); const TopoDS_Edge& E = EX1.Current();
@ -698,8 +698,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
mySlface = SlidMap; mySlface = SlidMap;
} }
// ---Arguments de LocOpe_LinearForm : arguments du prism // ---Arguments of LocOpe_LinearForm : arguments of the prism sliding
// glissement
if(Sliding) { if(Sliding) {
TopoDS_Face F; TopoDS_Face F;
BB.MakeFace(F, myPln, myTol); BB.MakeFace(F, myPln, myTol);
@ -711,7 +710,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Cas sans glissement : construction de la face profil // ---Case without sliding : construction of the profile face
if(!Sliding) { if(!Sliding) {
#ifdef DEB #ifdef DEB
if (trc) { if (trc) {
@ -737,11 +736,11 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Propagation sur les faces du shape initial // ---Propagation on faces of the initial shape
// pour trouver les faces concernees par la nervure // to find the faces concerned by the rib
Standard_Boolean falseside = Standard_True; Standard_Boolean falseside = Standard_True;
Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
// Controle si on a ce qu`il faut pour avoir la matiere du bon cote // Control if there is everything required to have the material at the proper side
if(falseside == Standard_False) { if(falseside == Standard_False) {
#ifdef DEB #ifdef DEB
cout << "Verify plane and wire orientation" << endl; cout << "Verify plane and wire orientation" << endl;
@ -825,7 +824,7 @@ void BRepFeat_MakeLinearForm::Add(const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : construction de nervure a partir d'un profile et du shape init //purpose : construction of rib from a profile and the initial shape
//======================================================================= //=======================================================================
void BRepFeat_MakeLinearForm::Perform() void BRepFeat_MakeLinearForm::Perform()
@ -864,11 +863,11 @@ void BRepFeat_MakeLinearForm::Perform()
else else
theForm.Perform(myPbase, V, myDir1, myFirstPnt, myLastPnt); theForm.Perform(myPbase, V, myDir1, myFirstPnt, myLastPnt);
TopoDS_Shape VraiForm = theForm.Shape(); // primitive de la nervure TopoDS_Shape VraiForm = theForm.Shape(); // primitive of the rib
myFacesForDraft.Append(theForm.FirstShape()); myFacesForDraft.Append(theForm.FirstShape());
myFacesForDraft.Append(theForm.LastShape()); myFacesForDraft.Append(theForm.LastShape());
MajMap(myPbase,theForm,myMap,myFShape,myLShape); // gestion de descendants MajMap(myPbase,theForm,myMap,myFShape,myLShape); // management of descendants
TopExp_Explorer exx(myPbase, TopAbs_EDGE); TopExp_Explorer exx(myPbase, TopAbs_EDGE);
for(; exx.More(); exx.Next()) { for(; exx.More(); exx.Next()) {
@ -884,7 +883,7 @@ void BRepFeat_MakeLinearForm::Perform()
} }
myGShape = VraiForm; myGShape = VraiForm;
SetGluedFaces(mySlface, theForm, myGluedF); // gestion des faces de glissement SetGluedFaces(mySlface, theForm, myGluedF); // management of sliding faces
if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) { if(!myGluedF.IsEmpty() && !mySUntil.IsNull()) {
#ifdef DEB #ifdef DEB
@ -937,8 +936,8 @@ void BRepFeat_MakeLinearForm::Perform()
//======================================================================= //=======================================================================
//function : Propagate //function : Propagate
//purpose : propagation sur les faces du shape initial, recherche //purpose : propagation on faces of the initial shape, find
// des faces concernees par la nervure // faces concerned by the rib
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_MakeLinearForm::Propagate(TopTools_ListOfShape& SliList, Standard_Boolean BRepFeat_MakeLinearForm::Propagate(TopTools_ListOfShape& SliList,
const TopoDS_Face& fac, const TopoDS_Face& fac,
@ -1013,7 +1012,7 @@ void BRepFeat_MakeLinearForm::Perform()
myListOfEdges.Clear(); myListOfEdges.Clear();
myListOfEdges.Append(eb); myListOfEdges.Append(eb);
// Les deux points sont sur la meme face. // two points are on the same face.
if(LastOK && FirstOK) { if(LastOK && FirstOK) {
return result; return result;
} }
@ -1040,7 +1039,7 @@ void BRepFeat_MakeLinearForm::Perform()
tvp=t1; tvp=t1;
} }
// retrouver l'edge connexe a v1 ou v2: // find edge connected to v1 or v2:
for (ex.Init(CurrentFace, TopAbs_EDGE); ex.More(); ex.Next()) { for (ex.Init(CurrentFace, TopAbs_EDGE); ex.More(); ex.Next()) {
const TopoDS_Edge& rfe = TopoDS::Edge(ex.Current()); const TopoDS_Edge& rfe = TopoDS::Edge(ex.Current());
@ -1058,8 +1057,8 @@ void BRepFeat_MakeLinearForm::Perform()
if (index != 0) { if (index != 0) {
if (dist2min <= BRep_Tool::Tolerance(rfe) * BRep_Tool::Tolerance(rfe)) { if (dist2min <= BRep_Tool::Tolerance(rfe) * BRep_Tool::Tolerance(rfe)) {
FirstEdge = rfe; FirstEdge = rfe;
// Si l'edge n'est pas perpendiculaire au plan de la nervure il // If the edge is not perpendicular to the plane of the rib
// faut mettre Sliding(result) a faux. // it is required to set Sliding(result) to false.
if (result) { if (result) {
result=Standard_False; result=Standard_False;
ve1 = TopExp::FirstVertex(rfe,Standard_True); ve1 = TopExp::FirstVertex(rfe,Standard_True);
@ -1146,7 +1145,7 @@ void BRepFeat_MakeLinearForm::Perform()
} }
} }
else { else {
// on arrive pas a chainer la section // end by chaining the section
return Standard_False; return Standard_False;
} }
// #ifdef DEB // #ifdef DEB
@ -1167,7 +1166,7 @@ void BRepFeat_MakeLinearForm::Perform()
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion de descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static void MajMap(const TopoDS_Shape& theB, static void MajMap(const TopoDS_Shape& theB,
@ -1211,14 +1210,14 @@ static void MajMap(const TopoDS_Shape& theB,
//======================================================================= //=======================================================================
//function : SetGluedFaces //function : SetGluedFaces
//purpose : gestion des faces de collage //purpose : management of faces of gluing
//======================================================================= //=======================================================================
static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap, static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap,
LocOpe_LinearForm& thePrism, LocOpe_LinearForm& thePrism,
TopTools_DataMapOfShapeShape& theMap) TopTools_DataMapOfShapeShape& theMap)
{ {
// Glissements // Slidings
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {

View File

@ -131,7 +131,7 @@ void BRepFeat_MakePipe::Init(const TopoDS_Shape& Sbase,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : add faces de collage //purpose : add faces of gluing
//======================================================================= //=======================================================================
void BRepFeat_MakePipe::Add(const TopoDS_Edge& E, void BRepFeat_MakePipe::Add(const TopoDS_Edge& E,
@ -245,7 +245,7 @@ void BRepFeat_MakePipe::Perform()
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : jusqu'au shape Until //purpose : till shape Until
//======================================================================= //=======================================================================
void BRepFeat_MakePipe::Perform(const TopoDS_Shape& Until) void BRepFeat_MakePipe::Perform(const TopoDS_Shape& Until)
@ -289,7 +289,7 @@ void BRepFeat_MakePipe::Perform(const TopoDS_Shape& Until)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : entre From et Until //purpose : between From and Until
//======================================================================= //=======================================================================
void BRepFeat_MakePipe::Perform(const TopoDS_Shape& From, void BRepFeat_MakePipe::Perform(const TopoDS_Shape& From,
@ -350,7 +350,7 @@ void BRepFeat_MakePipe::Perform(const TopoDS_Shape& From,
//======================================================================= //=======================================================================
//function : Curves //function : Curves
//purpose : courbes paralleles au wire-generarice du pipe //purpose : curves parallel to the generating wire of the pipe
//======================================================================= //=======================================================================
void BRepFeat_MakePipe::Curves(TColGeom_SequenceOfCurve& scur) void BRepFeat_MakePipe::Curves(TColGeom_SequenceOfCurve& scur)
@ -360,7 +360,7 @@ void BRepFeat_MakePipe::Curves(TColGeom_SequenceOfCurve& scur)
//======================================================================= //=======================================================================
//function : BarycCurve //function : BarycCurve
//purpose : passe par le centre des masses //purpose : pass through the center of mass
//======================================================================= //=======================================================================
Handle(Geom_Curve) BRepFeat_MakePipe::BarycCurve() Handle(Geom_Curve) BRepFeat_MakePipe::BarycCurve()
@ -371,7 +371,7 @@ Handle(Geom_Curve) BRepFeat_MakePipe::BarycCurve()
//======================================================================= //=======================================================================
//function : SetGluedFaces //function : SetGluedFaces
//purpose : gestion des faces de collage et glissement //purpose : management of faces of gluing and sliding
//======================================================================= //=======================================================================
static void SetGluedFaces(const TopoDS_Face& theSkface, static void SetGluedFaces(const TopoDS_Face& theSkface,
@ -403,7 +403,7 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
} }
} }
// Glissements // Sliding
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {
@ -427,7 +427,7 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion de descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static void MajMap(const TopoDS_Shape& theB, static void MajMap(const TopoDS_Shape& theB,

View File

@ -178,7 +178,7 @@ void BRepFeat_MakePrism::Init(const TopoDS_Shape& Sbase,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : add elements de glissemant (edge sur face) //purpose : add elements of sliding (edge on face)
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::Add(const TopoDS_Edge& E, void BRepFeat_MakePrism::Add(const TopoDS_Edge& E,
@ -225,8 +225,8 @@ void BRepFeat_MakePrism::Add(const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : construction du prism de longueur Length et //purpose : construction of prism of length Length and
// appel de reconstruction topo // call of reconstruction topo
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::Perform(const Standard_Real Length) void BRepFeat_MakePrism::Perform(const Standard_Real Length)
@ -244,24 +244,24 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
PerfSelectionValid(); PerfSelectionValid();
gp_Vec V(Length*myDir); gp_Vec V(Length*myDir);
//construction de prism de hauteur Length //construction of prism of height Length
LocOpe_Prism thePrism(myPbase,V); LocOpe_Prism thePrism(myPbase,V);
TopoDS_Shape VraiPrism = thePrism.Shape(); TopoDS_Shape VraiPrism = thePrism.Shape();
// gestion des descendants // management of descendants
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
myGShape = VraiPrism; // la primitive myGShape = VraiPrism; // the primitive
GeneratedShapeValid(); GeneratedShapeValid();
TopoDS_Face FFace; TopoDS_Face FFace;
Standard_Boolean found = Standard_False; Standard_Boolean found = Standard_False;
// essai de detecter des faces de collage // try to detect the faces of gluing
//cas le top du prism est tgt au shape initial // in case if the top of the prism is tangent to the initial shape
if(!mySkface.IsNull() || !mySlface.IsEmpty()) { if(!mySkface.IsNull() || !mySlface.IsEmpty()) {
if(myLShape.ShapeType() == TopAbs_WIRE) { if(myLShape.ShapeType() == TopAbs_WIRE) {
@ -291,20 +291,20 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
} }
} }
// gestion des faces de collage donnees par l'utilisateur // management of faces of gluing given by the user
// SetGluedFaces(mySkface, mySbase, myPbase, mySlface, thePrism, myGluedF); // SetGluedFaces(mySkface, mySbase, myPbase, mySlface, thePrism, myGluedF);
GluedFacesValid(); GluedFacesValid();
// VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF); // VerifGluedFaces(mySkface, myPbase, myBCurve, myCurves, thePrism, myGluedF);
if(!myGluedF.IsEmpty()) { // cas collage if(!myGluedF.IsEmpty()) { // case gluing
myJustGluer = Standard_True; myJustGluer = Standard_True;
thePrism.Curves(myCurves); thePrism.Curves(myCurves);
myBCurve = thePrism.BarycCurve(); myBCurve = thePrism.BarycCurve();
GlobalPerform(); // reconstruction topologique GlobalPerform(); // topological reconstruction
} }
// si il n'y a pas de collage -> appel des ope topo // if there is no gluing -> call of ope topo
if(!myJustGluer) { if(!myJustGluer) {
if(myFuse == 1 && !myJustFeat) { if(myFuse == 1 && !myJustFeat) {
//modified by NIZNHY-PKV Thu Mar 21 17:55:30 2002 f //modified by NIZNHY-PKV Thu Mar 21 17:55:30 2002 f
@ -338,8 +338,8 @@ void BRepFeat_MakePrism::Perform(const Standard_Real Length)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : construction de prism oriente vers la face Until, suffisemment //purpose : construction of prism oriented at the face Until, sufficiently
// long; appel de reconstruction topo // long; call of topological reconstruction
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until) void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
@ -368,11 +368,11 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
Standard_Real Height = HeightMax(mySbase, mySkface, mySFrom, mySUntil); Standard_Real Height = HeightMax(mySbase, mySkface, mySFrom, mySUntil);
gp_Vec V(2*sens*Height*myDir); gp_Vec V(2*sens*Height*myDir);
// construction du prism long // construction of long prism
LocOpe_Prism thePrism(myPbase,V); LocOpe_Prism thePrism(myPbase,V);
TopoDS_Shape VraiPrism = thePrism.Shape(); TopoDS_Shape VraiPrism = thePrism.Shape();
// dans le cas de support de face Until // in case of support of face Until
if(!Trf) { if(!Trf) {
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
myGShape = VraiPrism; myGShape = VraiPrism;
@ -386,13 +386,13 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
myBCurve = thePrism.BarycCurve(); myBCurve = thePrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
else { // until support -> passage en ope topo else { // until support -> passage to topological operations
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
TColGeom_SequenceOfCurve scur; TColGeom_SequenceOfCurve scur;
scur.Clear(); scur.Clear();
scur.Append(C); scur.Append(C);
// sens du prism en fonction de Until // direction of the prism depending on Until
LocOpe_CSIntersector ASI(mySUntil); LocOpe_CSIntersector ASI(mySUntil);
ASI.Perform(scur); ASI.Perform(scur);
@ -447,7 +447,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
} }
} }
} }
/* // boucle de controle de descendance /* // loop of control of descendance
TopExp_Explorer expr(mySbase, TopAbs_FACE); TopExp_Explorer expr(mySbase, TopAbs_FACE);
char nom1[20], nom2[20]; char nom1[20], nom2[20];
@ -487,8 +487,8 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : construction d'un prisme suffisemment long et bien oriente //purpose : construction of a sufficiently long and properly oriented prism
// appel de reconstruction topo // call of topological reconstruction
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From, void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
@ -539,12 +539,12 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
return; return;
} }
// longueur en fonction des boites englobantes // length depending on bounding boxes
Standard_Real Height = HeightMax(mySbase, mySkface, mySFrom, mySUntil); Standard_Real Height = HeightMax(mySbase, mySkface, mySFrom, mySUntil);
Handle(Geom_Curve) C = TestCurve(myPbase,myDir); Handle(Geom_Curve) C = TestCurve(myPbase,myDir);
Standard_Integer sens; // sens de prism Standard_Integer sens; // direction of prism
Standard_Integer tran; // transfert de prism Standard_Integer tran; // transfer of prism
if(From.IsSame(Until)) { if(From.IsSame(Until)) {
sens = 1; sens = 1;
tran = -1; tran = -1;
@ -578,7 +578,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
myBCurve = thePrism.BarycCurve(); myBCurve = thePrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
else { // cas until support -> ope topo else { // case until support -> topological operation
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
TColGeom_SequenceOfCurve scur; TColGeom_SequenceOfCurve scur;
scur.Clear(); scur.Clear();
@ -668,7 +668,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
Done(); Done();
} }
} }
// controle historique // control history
/* /*
TopExp_Explorer expr(mySbase, TopAbs_FACE); TopExp_Explorer expr(mySbase, TopAbs_FACE);
char nom1[20], nom2[20]; char nom1[20], nom2[20];
@ -709,7 +709,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From,
//======================================================================= //=======================================================================
//function : PerformUntilEnd //function : PerformUntilEnd
//purpose : construction d'un prism et reconstruction //purpose : construction of a prism and reconstruction
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::PerformUntilEnd() void BRepFeat_MakePrism::PerformUntilEnd()
@ -797,7 +797,7 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
LocOpe_Prism thePrism(myPbase,Vect,Vtra); LocOpe_Prism thePrism(myPbase,Vect,Vtra);
TopoDS_Shape VraiPrism = thePrism.Shape(); TopoDS_Shape VraiPrism = thePrism.Shape();
if(!Trf) { // cas face until if(!Trf) { // case face until
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
myGShape = VraiPrism; myGShape = VraiPrism;
GeneratedShapeValid(); GeneratedShapeValid();
@ -807,7 +807,7 @@ void BRepFeat_MakePrism::PerformFromEnd(const TopoDS_Shape& Until)
myBCurve = thePrism.BarycCurve(); myBCurve = thePrism.BarycCurve();
GlobalPerform(); GlobalPerform();
} }
else { // cas support else { // case support
MajMap(myPbase,thePrism,myMap,myFShape,myLShape); MajMap(myPbase,thePrism,myMap,myFShape,myLShape);
TColGeom_SequenceOfCurve scur; TColGeom_SequenceOfCurve scur;
scur.Clear(); scur.Clear();
@ -1075,7 +1075,7 @@ void BRepFeat_MakePrism::PerformUntilHeight(const TopoDS_Shape& Until,
//======================================================================= //=======================================================================
//function : Curves //function : Curves
//purpose : sequence de courbes paralleles a l'axe de prism //purpose : sequence of curves parallel to the axis of prism
//======================================================================= //=======================================================================
void BRepFeat_MakePrism::Curves(TColGeom_SequenceOfCurve& scur) void BRepFeat_MakePrism::Curves(TColGeom_SequenceOfCurve& scur)
@ -1085,8 +1085,8 @@ void BRepFeat_MakePrism::Curves(TColGeom_SequenceOfCurve& scur)
//======================================================================= //=======================================================================
//function : BarycCurve //function : BarycCurve
//purpose : courbe parallele a l'axe du prisme passant par le centre des //purpose : curve parallel to the axis of the prism passing through the center
// masses // of masses
//======================================================================= //=======================================================================
Handle(Geom_Curve) BRepFeat_MakePrism::BarycCurve() Handle(Geom_Curve) BRepFeat_MakePrism::BarycCurve()
@ -1097,8 +1097,8 @@ Handle(Geom_Curve) BRepFeat_MakePrism::BarycCurve()
//======================================================================= //=======================================================================
//function : HeightMax //function : HeightMax
//purpose : Calcul de la hauteur du prisme selon les parametres de //purpose : Calculate the height of the prism following the parameters of
// boite englobante // bounding box
//======================================================================= //=======================================================================
static Standard_Real HeightMax(const TopoDS_Shape& theSbase, static Standard_Real HeightMax(const TopoDS_Shape& theSbase,
@ -1167,7 +1167,7 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,
//======================================================================= //=======================================================================
//function : SensOfPrism //function : SensOfPrism
//purpose : sens de prism en fonction du shape Until //purpose : Direction of the prism depending on the shape Until
//======================================================================= //=======================================================================
Standard_Integer SensOfPrism(const Handle(Geom_Curve) C, Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
const TopoDS_Shape& Until) const TopoDS_Shape& Until)
@ -1193,7 +1193,7 @@ Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
//======================================================================= //=======================================================================
//function : SetGluedFaces //function : SetGluedFaces
//purpose : gestion de faces de collage //purpose : management of gluing faces
//======================================================================= //=======================================================================
static void SetGluedFaces(const TopoDS_Face& theSkface, static void SetGluedFaces(const TopoDS_Face& theSkface,
@ -1224,7 +1224,7 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
} }
} }
// Glissements // Sliding
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {
@ -1248,8 +1248,8 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : VerifGluedFaces //function : VerifGluedFaces
//purpose : Verification intersection Outil/theSkface = thePbase //purpose : Verification intersection Tool/theSkface = thePbase
// Si oui -> OK si non -> cas sans collage // If yes -> OK otherwise -> case without gluing
//======================================================================= //=======================================================================
#ifdef DEB #ifdef DEB
static void VerifGluedFaces(const TopoDS_Face& theSkface, static void VerifGluedFaces(const TopoDS_Face& theSkface,
@ -1301,7 +1301,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
if (!GluedFaces) { if (!GluedFaces) {
#ifdef DEB #ifdef DEB
Standard_Boolean trc = BRepFeat_GettraceFEAT(); Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << " Intersection Prism/skface : pas de collage" << endl; if (trc) cout << " Intersection Prism/skface : no gluing" << endl;
#endif #endif
theMap.Clear(); theMap.Clear();
} }
@ -1311,7 +1311,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion des descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static void MajMap(const TopoDS_Shape& theB, static void MajMap(const TopoDS_Shape& theB,
@ -1352,7 +1352,7 @@ static void MajMap(const TopoDS_Shape& theB,
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion des descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static Handle(Geom_Curve) TestCurve(const TopoDS_Shape& Base, static Handle(Geom_Curve) TestCurve(const TopoDS_Shape& Base,
@ -1376,7 +1376,7 @@ static Handle(Geom_Curve) TestCurve(const TopoDS_Shape& Base,
//======================================================================= //=======================================================================
//function : ToFuse //function : ToFuse
//purpose : face SameDomaine ou pas //purpose : face SameDomaine or not
//======================================================================= //=======================================================================
Standard_Boolean ToFuse(const TopoDS_Face& F1, Standard_Boolean ToFuse(const TopoDS_Face& F1,
@ -1415,7 +1415,7 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
Standard_Boolean ValRet = Standard_False; Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // pour appliquer la location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());

View File

@ -166,7 +166,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : add faces et edges de glissement //purpose : add faces add edges of sliding
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E, void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
@ -342,7 +342,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : feature jusqu'au shape Until //purpose : feature till shape Until
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until) void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
@ -374,13 +374,13 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
Standard_Boolean Trf = TransformShapeFU(1); Standard_Boolean Trf = TransformShapeFU(1);
ShapeUntilValid(); ShapeUntilValid();
// On fait systematiquement un revol quasi-complet // Do systematically almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); // BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular());
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
if(!TourComplet) { if(!TourComplet) {
Angle = 2.*PI- 3*PI/180.; Angle = 2.*PI- 3*PI/180.;
#ifdef DEB #ifdef DEB
if (trc) cout << " No complete Revol" << endl; if (trc) cout << " No complete Revolution" << endl;
#endif #endif
} }
theRevol.Perform(myPbase, myAxis, Angle); theRevol.Perform(myPbase, myAxis, Angle);
@ -471,7 +471,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
} }
} }
} }
// boucle de controle de descendance // Loop of control of descendance
/* /*
TopExp_Explorer expr(mySbase, TopAbs_FACE); TopExp_Explorer expr(mySbase, TopAbs_FACE);
char nom1[20], nom2[20]; char nom1[20], nom2[20];
@ -511,7 +511,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
//======================================================================= //=======================================================================
//function : Perform //function : Perform
//purpose : feature limitee par les deux shapes //purpose : feature limited by two shapes
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From, void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
@ -680,7 +680,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
//======================================================================= //=======================================================================
//function : PerformThruAll //function : PerformThruAll
//purpose : feature a travers tout le shape initial //purpose : feature throughout the initial shape
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::PerformThruAll() void BRepFeat_MakeRevol::PerformThruAll()
@ -694,7 +694,7 @@ void BRepFeat_MakeRevol::PerformThruAll()
//======================================================================= //=======================================================================
//function : PerformUntilAngle //function : PerformUntilAngle
//purpose : feature jusqu'au shape Until definie avec l'angle //purpose : feature till shape Until defined with the angle
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until, void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
@ -727,7 +727,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
Standard_Boolean Trf = TransformShapeFU(1); Standard_Boolean Trf = TransformShapeFU(1);
ShapeUntilValid(); ShapeUntilValid();
// On fait systematiquement un revol quasi-complet // Produce systematicallt an almost complete revolution
// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); // BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular());
LocOpe_Revol theRevol; LocOpe_Revol theRevol;
theRevol.Perform(myPbase, myAxis, Angle); theRevol.Perform(myPbase, myAxis, Angle);
@ -821,7 +821,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
} }
//======================================================================= //=======================================================================
//function : Curves //function : Curves
//purpose : cercles parallels a la generatrice du revol //purpose : circles parallel to the generating edge of revolution
//======================================================================= //=======================================================================
void BRepFeat_MakeRevol::Curves(TColGeom_SequenceOfCurve& scur) void BRepFeat_MakeRevol::Curves(TColGeom_SequenceOfCurve& scur)
@ -831,7 +831,7 @@ void BRepFeat_MakeRevol::Curves(TColGeom_SequenceOfCurve& scur)
//======================================================================= //=======================================================================
//function : BarycCurve //function : BarycCurve
//purpose : passe par le centre des masses de la primitive //purpose : pass through the center of mass of the primitive
//======================================================================= //=======================================================================
Handle(Geom_Curve) BRepFeat_MakeRevol::BarycCurve() Handle(Geom_Curve) BRepFeat_MakeRevol::BarycCurve()
@ -842,7 +842,7 @@ Handle(Geom_Curve) BRepFeat_MakeRevol::BarycCurve()
//======================================================================= //=======================================================================
//function : SetGluedFaces //function : SetGluedFaces
//purpose : gestion des faces de collage //purpose : management of gluing faces
//======================================================================= //=======================================================================
static void SetGluedFaces(const TopoDS_Face& theSkface, static void SetGluedFaces(const TopoDS_Face& theSkface,
@ -874,7 +874,7 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
} }
} }
// Glissements // Sliding
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {
@ -897,8 +897,8 @@ static void SetGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : VerifGluedFaces //function : VerifGluedFaces
//purpose : Verification intersection Outil/theSkface = thePbase //purpose : Check intersection Tool/theSkface = thePbase
// Si oui -> OK si non -> cas sans collage // if yes -> OK otherwise -> case without gluing
//======================================================================= //=======================================================================
static void VerifGluedFaces(const TopoDS_Face& theSkface, static void VerifGluedFaces(const TopoDS_Face& theSkface,
@ -950,7 +950,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
if (!GluedFaces) { if (!GluedFaces) {
#ifdef DEB #ifdef DEB
Standard_Boolean trc = BRepFeat_GettraceFEAT(); Standard_Boolean trc = BRepFeat_GettraceFEAT();
if (trc) cout << " Intersection Revol/skface : pas de collage" << endl; if (trc) cout << " Intersection Revol/skface : no gluing" << endl;
#endif #endif
theMap.Clear(); theMap.Clear();
} }
@ -959,7 +959,7 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion de descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static void MajMap(const TopoDS_Shape& theB, static void MajMap(const TopoDS_Shape& theB,
@ -1001,7 +1001,7 @@ static void MajMap(const TopoDS_Shape& theB,
//======================================================================= //=======================================================================
//function : ToFuse //function : ToFuse
//purpose : deux faces samedomaine ou pas //purpose : two faces samedomaine or not
//======================================================================= //=======================================================================
Standard_Boolean ToFuse(const TopoDS_Face& F1, Standard_Boolean ToFuse(const TopoDS_Face& F1,
@ -1040,7 +1040,7 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
Standard_Boolean ValRet = Standard_False; Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) { if (typS1 == STANDARD_TYPE(Geom_Plane)) {
S1 = BRep_Tool::Surface(F1); // pour appliquer la location. S1 = BRep_Tool::Surface(F1); // to apply the location.
S2 = BRep_Tool::Surface(F2); S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln()); gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln());
gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln()); gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());

View File

@ -160,8 +160,8 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
Standard_Boolean RevolRib = Standard_True; Standard_Boolean RevolRib = Standard_True;
Done(); Done();
// modify = 0 si on ne veut pas faire de glissement // modify = 0 if it is not required to make sliding
// = 1 si on veut essayer de faire un glissement // = 1 if it is intended to try to make sliding
Standard_Boolean Sliding = Modify; Standard_Boolean Sliding = Modify;
myAxe = Axis; myAxe = Axis;
@ -243,7 +243,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
#endif #endif
// ---Determination Tolerance : tolerance max sur les parametres // ---Determination Tolerance : tolerance max on parameters
myTol = Precision::Confusion(); myTol = Precision::Confusion();
exx.Init(W, TopAbs_VERTEX); exx.Init(W, TopAbs_VERTEX);
@ -274,7 +274,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
myFShape.Nullify(); myFShape.Nullify();
myLShape.Nullify(); myLShape.Nullify();
// ---Calcul boite englobante // ---Calculate bounding box
BRep_Builder BB; BRep_Builder BB;
TopTools_ListOfShape theList; TopTools_ListOfShape theList;
@ -289,7 +289,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Solid BndBox = Bndbox.Solid(); TopoDS_Solid BndBox = Bndbox.Solid();
// ---Construction de la face plan de travail (section boite englobante) // ---Construction of the working plane face (section bounding box)
BRepLib_MakeFace PlaneF(myPln->Pln(), -6.*myBnd, BRepLib_MakeFace PlaneF(myPln->Pln(), -6.*myBnd,
6.*myBnd, -6.*myBnd, 6.*myBnd); 6.*myBnd, -6.*myBnd, 6.*myBnd);
TopoDS_Face PlaneFace = TopoDS::Face(PlaneF.Shape()); TopoDS_Face PlaneFace = TopoDS::Face(PlaneF.Shape());
@ -306,7 +306,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Face BndFace = TopoDS::Face(Bndface.Shape()); TopoDS_Face BndFace = TopoDS::Face(Bndface.Shape());
// ---Recherche des faces d'appui de la nervure // ---Find base faces of the rib
TopoDS_Edge FirstEdge, LastEdge; TopoDS_Edge FirstEdge, LastEdge;
TopoDS_Face FirstFace, LastFace; TopoDS_Face FirstFace, LastFace;
TopoDS_Vertex FirstVertex, LastVertex; TopoDS_Vertex FirstVertex, LastVertex;
@ -335,23 +335,23 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Point detrompeur pour le cote du wire a remplir - cote matiere // ---Proofing Point for the side of the wire to be filled - material side
gp_Pnt CheckPnt = CheckPoint(FirstEdge, bnd/10., myPln); gp_Pnt CheckPnt = CheckPoint(FirstEdge, bnd/10., myPln);
// Standard_Real f, l; // Standard_Real f, l;
// ---Controle glissement valable // ---Control sliding valid
// Plein de cas ou on sort du glissement // Many cases when the sliding is abandoned
Standard_Integer Concavite = 3; // a priori le profile n'est pas concave Standard_Integer Concavite = 3; // a priori the profile is not concave
myFirstPnt = BRep_Tool::Pnt(FirstVertex); myFirstPnt = BRep_Tool::Pnt(FirstVertex);
myLastPnt = BRep_Tool::Pnt(LastVertex); myLastPnt = BRep_Tool::Pnt(LastVertex);
// SliList : liste des faces concernees par la nervure // SliList : list of faces concerned by the rib
TopTools_ListOfShape SliList; TopTools_ListOfShape SliList;
SliList.Append(FirstFace); SliList.Append(FirstFace);
if(Sliding) { // glissement if(Sliding) { // sliding
#ifdef DEB #ifdef DEB
if (trc) cout << " Sliding" << endl; if (trc) cout << " Sliding" << endl;
#endif #endif
@ -368,7 +368,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
Sliding = Standard_False; Sliding = Standard_False;
} }
if(Sliding) { // glissement if(Sliding) { // sliding
Handle(Geom_Surface) ss = BRep_Tool::Surface(LastFace); Handle(Geom_Surface) ss = BRep_Tool::Surface(LastFace);
if (ss->DynamicType() == if (ss->DynamicType() ==
STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
@ -382,15 +382,14 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
Sliding = Standard_False; Sliding = Standard_False;
} }
// Controle uniquement points de depart et d'arrivee // Control only start and end points no control at the middle to improve
// -> pas de controle au milieu - a ameliorer // If make a control between Surface and segment 2 points limited
// Si on faisait un controle entre Surface et sgement entre les 2 points limite // -> too expensive - to improve
// -> tres cher - a ameliorer
//gp_Pnt FirstCenter, LastCenter; //gp_Pnt FirstCenter, LastCenter;
gp_Circ FirstCircle, LastCircle; gp_Circ FirstCircle, LastCircle;
Handle(Geom_Curve) FirstCrv, LastCrv; Handle(Geom_Curve) FirstCrv, LastCrv;
if(Sliding) { // glissement if(Sliding) { // sliding
GeomAPI_ProjectPointOnCurve proj(myFirstPnt, Line); GeomAPI_ProjectPointOnCurve proj(myFirstPnt, Line);
if(proj.NbPoints() < 1) { if(proj.NbPoints() < 1) {
#ifdef DEB #ifdef DEB
@ -450,7 +449,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
Sliding = Standard_False; Sliding = Standard_False;
} }
if(Sliding && !PtOnLastEdge) { if(Sliding && !PtOnLastEdge) {
BRepExtrema_ExtCF ext2(ee2, LastFace); // ExtCF : courbes et surfaces BRepExtrema_ExtCF ext2(ee2, LastFace); // ExtCF : curves and surfaces
if(ext2.NbExt() < 1 || ext2.SquareDistance(1) > Precision::Confusion() * Precision::Confusion()) if(ext2.NbExt() < 1 || ext2.SquareDistance(1) > Precision::Confusion() * Precision::Confusion())
Sliding = Standard_False; Sliding = Standard_False;
} }
@ -507,13 +506,13 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// On construit un gros profil qui va jusqu`a la boite englobante // Construct a great profile that goes till the bounding box
// -> par tangence avec premier et dernier edge du Wire // -> by tangency with first and last edge of the Wire
// -> par normales aux faces d'appui : statistiquement meilleur // -> by normals to base faces : statistically better
// On intersecte le tout pour trouver le profil final // Intersect everythin to find the final profile
// ---cas de glissement : construction de la face profil // ---case of sliding : construction of the face profile
if(Sliding) { if(Sliding) {
#ifdef DEB #ifdef DEB
if (trc) cout << " still Sliding" << endl; if (trc) cout << " still Sliding" << endl;
@ -535,11 +534,11 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Propagation sur les faces du shape initial // ---Propagation on faces of the initial shape
// pour trouver les faces concernees par la nervure // to find the faces concerned by the rib
Standard_Boolean falseside = Standard_True; Standard_Boolean falseside = Standard_True;
Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); Sliding = Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
// Controle si on a ce qu`il faut pour avoir la matiere du bon cote // Control if there is everything required to have the material at the proper side
if(falseside == Standard_False) { if(falseside == Standard_False) {
#ifdef DEB #ifdef DEB
cout << " Verify plane and wire orientation" << endl; cout << " Verify plane and wire orientation" << endl;
@ -551,7 +550,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Generation du profile de base de la nervure // ---Generation of the base profile of the rib
TopoDS_Wire w; TopoDS_Wire w;
BB.MakeWire(w); BB.MakeWire(w);
@ -559,10 +558,10 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
TopoDS_Vertex theFV; TopoDS_Vertex theFV;
thePreviousEdge.Nullify(); thePreviousEdge.Nullify();
// compteur du nombre d`edges pour remplir la map // counter of the number of edges to fill the map
Standard_Integer counter = 1; Standard_Integer counter = 1;
// ---cas de glissement // ---case of sliding
if(Sliding && !myListOfEdges.IsEmpty()) { if(Sliding && !myListOfEdges.IsEmpty()) {
BRepTools_WireExplorer EX1(myWire); BRepTools_WireExplorer EX1(myWire);
for(; EX1.More(); EX1.Next()) { for(; EX1.More(); EX1.Next()) {
@ -615,7 +614,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
} }
// Cas plusieurs edges // Case of several edges
if(!FirstEdge.IsSame(LastEdge)) { if(!FirstEdge.IsSame(LastEdge)) {
for(; EX1.More(); EX1.Next()) { for(; EX1.More(); EX1.Next()) {
const TopoDS_Edge& E = EX1.Current(); const TopoDS_Edge& E = EX1.Current();
@ -829,8 +828,8 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
mySlface = SlidMap; mySlface = SlidMap;
} }
// ---Arguments de LocOpe_LinearForm : arguments du prism // ---Arguments of LocOpe_LinearForm : arguments of the prism
// glissement // sliding
if(Sliding) { if(Sliding) {
TopoDS_Face F; TopoDS_Face F;
BB.MakeFace(F, myPln, myTol); BB.MakeFace(F, myPln, myTol);
@ -841,7 +840,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Cas sans glissement : construction de la face profil // ---Case without sliding : construction of the face profile
if(!Sliding) { if(!Sliding) {
#ifdef DEB #ifdef DEB
if (trc) { if (trc) {
@ -969,11 +968,11 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
} }
// ---Propagation sur les faces du shape initial // ---Propagation on the faces of the initial shape
// pour trouver les faces concernees par la nervure // to find the faces concerned by the rib
Standard_Boolean falseside = Standard_True; Standard_Boolean falseside = Standard_True;
Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside); Propagate(SliList, Prof, myFirstPnt, myLastPnt, falseside);
// Controle si on a ce qu`il faut pour avoir la matiere du bon cote // Control if there is everything required to have the material at the proper side
if(falseside == Standard_False) { if(falseside == Standard_False) {
#ifdef DEB #ifdef DEB
cout << " Verify plane and wire orientation" << endl; cout << " Verify plane and wire orientation" << endl;
@ -1017,7 +1016,7 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : add elements de collage //purpose : add elements of gluing
//======================================================================= //=======================================================================
void BRepFeat_MakeRevolutionForm::Add(const TopoDS_Edge& E, void BRepFeat_MakeRevolutionForm::Add(const TopoDS_Edge& E,
@ -1125,16 +1124,16 @@ void BRepFeat_MakeRevolutionForm::Perform()
} }
myPbase = Pbase; myPbase = Pbase;
trsf.Perform(mySkface, Standard_False); trsf.Perform(mySkface, Standard_False);
// flo : verif si il faut bien reaffecter le champ mySkface // flo : check if it is required to reattributr the field mySkface
// TopoDS_Face mySkface = TopoDS::Face(trsf.Shape()); // TopoDS_Face mySkface = TopoDS::Face(trsf.Shape());
mySkface = TopoDS::Face(trsf.Shape()); mySkface = TopoDS::Face(trsf.Shape());
} }
LocOpe_RevolutionForm theForm; LocOpe_RevolutionForm theForm;
theForm.Perform(myPbase, myAxe, (myAngle1+myAngle2)); theForm.Perform(myPbase, myAxe, (myAngle1+myAngle2));
TopoDS_Shape VraiForm = theForm.Shape(); // la primitive non-coupe TopoDS_Shape VraiForm = theForm.Shape(); // uncut primitive
// gestion de descendants // management of descendants
MajMap(myPbase,theForm,myMap,myFShape,myLShape); MajMap(myPbase,theForm,myMap,myFShape,myLShape);
myGluedF.Clear(); myGluedF.Clear();
@ -1198,7 +1197,7 @@ void BRepFeat_MakeRevolutionForm::Perform()
// coupe de la nervure par deux plans parallels // coupe de la nervure par deux plans parallels
TopTools_DataMapOfShapeListOfShape SlidingMap; TopTools_DataMapOfShapeListOfShape SlidingMap;
// gestion de descendants // management of descendants
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it1; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it1;
it1.Initialize(myMap); it1.Initialize(myMap);
@ -1252,10 +1251,10 @@ void BRepFeat_MakeRevolutionForm::Perform()
} }
// gestion des faces de glissement // gestion of faces of sliding
SetGluedFaces(mySlface, theForm, SlidingMap, myGluedF); SetGluedFaces(mySlface, theForm, SlidingMap, myGluedF);
VraiForm = trP.Shape(); // primitive coupee VraiForm = trP.Shape(); // primitive cut
if(!myGluedF.IsEmpty()) if(!myGluedF.IsEmpty())
myPerfSelection = BRepFeat_NoSelection; myPerfSelection = BRepFeat_NoSelection;
@ -1287,14 +1286,14 @@ void BRepFeat_MakeRevolutionForm::Perform()
return; return;
} }
LFPerform(); // reconstruction topologique LFPerform(); // topological reconstruction
} }
//======================================================================= //=======================================================================
//function : Propagate //function : Propagate
//purpose : propagation sur les faces du shape inital, rechrche des faces //purpose : propagation on the faces of the inital shape, find faces
// concernees par la nervure // concerned by the rib
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& SliList, Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& SliList,
@ -1496,7 +1495,7 @@ Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& Sl
TopoDS_Vertex Vpreprevious; Vpreprevious.Nullify(); TopoDS_Vertex Vpreprevious; Vpreprevious.Nullify();
while(!FirstOK) { while(!FirstOK) {
// retrouver l'edge connexe a v1: // find edge connected to v1:
gp_Pnt pt; gp_Pnt pt;
if(!v1.IsNull()) pt= BRep_Tool::Pnt(v1); if(!v1.IsNull()) pt= BRep_Tool::Pnt(v1);
gp_Pnt ptprev; gp_Pnt ptprev;
@ -1600,7 +1599,7 @@ Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& Sl
Vpreprevious.Nullify(); Vpreprevious.Nullify();
while(!LastOK) { while(!LastOK) {
// retrouver l'edge connexe a v2: // find edge connected to v2:
gp_Pnt pt; gp_Pnt pt;
if(!v2.IsNull()) pt= BRep_Tool::Pnt(v2); if(!v2.IsNull()) pt= BRep_Tool::Pnt(v2);
gp_Pnt ptprev; gp_Pnt ptprev;
@ -1700,7 +1699,7 @@ Standard_Boolean BRepFeat_MakeRevolutionForm::Propagate(TopTools_ListOfShape& Sl
//======================================================================= //=======================================================================
//function : MajMap //function : MajMap
//purpose : gestion de descendants //purpose : management of descendants
//======================================================================= //=======================================================================
static void MajMap(const TopoDS_Shape& theB, static void MajMap(const TopoDS_Shape& theB,
@ -1747,7 +1746,7 @@ static void MajMap(const TopoDS_Shape& theB,
//======================================================================= //=======================================================================
//function : SetGluedFaces //function : SetGluedFaces
//purpose : gestion des faces de glissement //purpose : managemnet of sliding faces
//======================================================================= //=======================================================================
static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap, static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap,
@ -1755,7 +1754,7 @@ static void SetGluedFaces(const TopTools_DataMapOfShapeListOfShape& theSlmap,
const TopTools_DataMapOfShapeListOfShape& SlidingMap, const TopTools_DataMapOfShapeListOfShape& SlidingMap,
TopTools_DataMapOfShapeShape& theMap) TopTools_DataMapOfShapeShape& theMap)
{ {
// Glissements // Slidings
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
if(!theSlmap.IsEmpty()) { if(!theSlmap.IsEmpty()) {
for (; itm.More(); itm.Next()) { for (; itm.More(); itm.Next()) {

View File

@ -99,7 +99,7 @@ Standard_IMPORT Standard_Boolean BRepFeat_GettraceFEATRIB();
//======================================================================= //=======================================================================
//function : LFPerform //function : LFPerform
//purpose : reconstruction topologique des nervures //purpose : topological reconstruction of ribs
//======================================================================= //=======================================================================
void BRepFeat_RibSlot::LFPerform() void BRepFeat_RibSlot::LFPerform()
@ -127,7 +127,7 @@ void BRepFeat_RibSlot::LFPerform()
} }
Standard_Boolean ChangeOpe = Standard_False; Standard_Boolean ChangeOpe = Standard_False;
// On espere qu`il n`y a qu`un solide dans le resultat // Hope that there is just a solid in the result
Standard_Boolean UntilInShape = Standard_False; Standard_Boolean UntilInShape = Standard_False;
TopTools_MapOfShape M; TopTools_MapOfShape M;
@ -174,7 +174,7 @@ void BRepFeat_RibSlot::LFPerform()
LocOpe_Gluer theGlue; LocOpe_Gluer theGlue;
//cas de collage //case of gluing
if (theOpe == 1) { if (theOpe == 1) {
Standard_Boolean Collage = Standard_True; Standard_Boolean Collage = Standard_True;
@ -216,12 +216,12 @@ void BRepFeat_RibSlot::LFPerform()
theOpe = 2; theOpe = 2;
ChangeOpe = Standard_True; ChangeOpe = Standard_True;
#ifdef DEB #ifdef DEB
cout << "Passage en ope. topologique" << endl; cout << "Passage to topological operations" << endl;
#endif #endif
} }
} }
// collage est toujours applicable // gluing is always applicable
if (theOpe == 1) { if (theOpe == 1) {
theGlue.Perform(); theGlue.Perform();
@ -232,7 +232,7 @@ void BRepFeat_RibSlot::LFPerform()
//TopTools_ListIteratorOfListOfShape itt1; //TopTools_ListIteratorOfListOfShape itt1;
if (!LShape.IsEmpty()) { if (!LShape.IsEmpty()) {
LocOpe_Builder theTOpe(theGlue.ResultingShape()); LocOpe_Builder theTOpe(theGlue.ResultingShape());
// On utilise LTool en temporaire // Use of LTool is temporary
for (it2.Initialize(LShape);it2.More();it2.Next()) { for (it2.Initialize(LShape);it2.More();it2.Next()) {
const TopTools_ListOfShape& ldf = myMap(it2.Value()); const TopTools_ListOfShape& ldf = myMap(it2.Value());
if (ldf.Extent() == 1 && ldf.First().IsSame(it2.Value())) { if (ldf.Extent() == 1 && ldf.First().IsSame(it2.Value())) {
@ -318,7 +318,7 @@ void BRepFeat_RibSlot::LFPerform()
theOpe = 2; theOpe = 2;
ChangeOpe = Standard_True; ChangeOpe = Standard_True;
#ifdef DEB #ifdef DEB
cout << "Passage en ope. topologique" << endl; cout << "Passage to. topologic operation" << endl;
#endif #endif
} }
@ -340,16 +340,16 @@ void BRepFeat_RibSlot::LFPerform()
theOpe = 2; theOpe = 2;
ChangeOpe = Standard_True; ChangeOpe = Standard_True;
#ifdef DEB #ifdef DEB
cout << "Passage en ope. topologique" << endl; cout << "Passage to topologic operation" << endl;
#endif #endif
} }
} }
// cas sans collage // case without gluing
if (theOpe == 2) { if (theOpe == 2) {
// Attention si echec de collage, myGShape avec collage n'est pas correct // Attention, if gluing fails, myGShape with gluing is not correct
if (ChangeOpe) { if (ChangeOpe) {
myStatusError = BRepFeat_NoGluer; myStatusError = BRepFeat_NoGluer;
NotDone(); NotDone();
@ -504,7 +504,7 @@ void BRepFeat_RibSlot::LFPerform()
// myStatusError = BRepFeat_LocOpeNotDone; // myStatusError = BRepFeat_LocOpeNotDone;
// } // }
// else { // else {
myStatusError = BRepFeat_LocOpeInvNotDone;// dernier recours (attention new et tangent edges) myStatusError = BRepFeat_LocOpeInvNotDone;// last resort (attention to new and tangent edges)
#ifdef DEB #ifdef DEB
if (trc) cout << " Parts of Tool : direct Ope. Top." << endl; if (trc) cout << " Parts of Tool : direct Ope. Top." << endl;
#endif #endif
@ -594,7 +594,7 @@ const TopTools_ListOfShape& BRepFeat_RibSlot::Generated
if(S.ShapeType() != TopAbs_FACE) { if(S.ShapeType() != TopAbs_FACE) {
myGenerated.Clear(); myGenerated.Clear();
if(myLFMap.IsEmpty() || !myLFMap.IsBound(S)) { if(myLFMap.IsEmpty() || !myLFMap.IsBound(S)) {
if (myMap.IsBound(S)) { // voir si on filtre sur face ou pas if (myMap.IsBound(S)) { // check if filter on face or not
static TopTools_ListOfShape list; static TopTools_ListOfShape list;
list.Clear(); list.Clear();
TopTools_ListIteratorOfListOfShape ite(myMap(S)); TopTools_ListIteratorOfListOfShape ite(myMap(S));
@ -727,7 +727,7 @@ void BRepFeat_RibSlot::UpdateDescendants(const LocOpe_Gluer& G)
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the belonging to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
myMap.ChangeFind(orig).Append(itm.Key()); myMap.ChangeFind(orig).Append(itm.Key());
@ -812,7 +812,7 @@ BRepFeat_StatusError BRepFeat_RibSlot::CurrentStatusError() const
//======================================================================= //=======================================================================
//function : CheckPoint //function : CheckPoint
//purpose : point detrompeur cote matiere (cote d'extrusion) //purpose : Proofing point material side (side of extrusion)
//======================================================================= //=======================================================================
gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e, gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e,
@ -824,9 +824,9 @@ gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e,
Standard_Boolean trc = BRepFeat_GettraceFEATRIB(); Standard_Boolean trc = BRepFeat_GettraceFEATRIB();
if (trc) cout << "BRepFeat_RibSlot::CheckPoint" << endl; if (trc) cout << "BRepFeat_RibSlot::CheckPoint" << endl;
#endif #endif
// Produit vectoriel : normale au plan X direction Wire // Vector product : normal to plane X direction Wire
// -> donne le cote matiere // -> gives the material side
// point detrompeur legerement a l'interieur cote matiere // Proofing point somewhat inside the material side
Standard_Real f, l; Standard_Real f, l;
Handle(Geom_Curve) cc = BRep_Tool::Curve(e, f, l); Handle(Geom_Curve) cc = BRep_Tool::Curve(e, f, l);
@ -847,7 +847,7 @@ gp_Pnt BRepFeat_RibSlot::CheckPoint(const TopoDS_Edge& e,
//======================================================================= //=======================================================================
//function : Normal //function : Normal
//purpose : calcul de la normale a une face dans un point //purpose : calculate the normal to a face in a point
//======================================================================= //=======================================================================
gp_Dir BRepFeat_RibSlot::Normal(const TopoDS_Face& F,const gp_Pnt& P) gp_Dir BRepFeat_RibSlot::Normal(const TopoDS_Face& F,const gp_Pnt& P)
@ -894,7 +894,7 @@ gp_Dir BRepFeat_RibSlot::Normal(const TopoDS_Face& F,const gp_Pnt& P)
//======================================================================= //=======================================================================
//function : IntPar //function : IntPar
//purpose : calcul du parametre d'un point sur une courbe //purpose : calculate the parameter of a point on a curve
//======================================================================= //=======================================================================
Standard_Real BRepFeat_RibSlot::IntPar(const Handle(Geom_Curve)& C, Standard_Real BRepFeat_RibSlot::IntPar(const Handle(Geom_Curve)& C,
@ -933,7 +933,7 @@ Standard_Real BRepFeat_RibSlot::IntPar(const Handle(Geom_Curve)& C,
//======================================================================= //=======================================================================
//function : EdgeExtention //function : EdgeExtention
//purpose : extention d'un edge en tangence //purpose : extention of a edge by tangence
//======================================================================= //=======================================================================
void BRepFeat_RibSlot::EdgeExtention(TopoDS_Edge& e, void BRepFeat_RibSlot::EdgeExtention(TopoDS_Edge& e,
@ -993,7 +993,7 @@ void BRepFeat_RibSlot::EdgeExtention(TopoDS_Edge& e,
//======================================================================= //=======================================================================
//function : ChoiceOfFaces //function : ChoiceOfFaces
//purpose : choix de la face d'appui dans le cas d'appui sur un edge //purpose : choose face of support in case of support on an edge
//======================================================================= //=======================================================================
TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces, TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces,
@ -1053,7 +1053,7 @@ TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces,
//======================================================================= //=======================================================================
//function : HeightMax //function : HeightMax
//purpose : Calcul de la hauteur du prisme selon les parametres d`une boite englobante //purpose : Calculate the height of the prism following the parameters of a bounding box
//======================================================================= //=======================================================================
Standard_Real BRepFeat_RibSlot::HeightMax(const TopoDS_Shape& theSbase, Standard_Real BRepFeat_RibSlot::HeightMax(const TopoDS_Shape& theSbase,
@ -1083,7 +1083,7 @@ Standard_Real BRepFeat_RibSlot::HeightMax(const TopoDS_Shape& theSbase,
//======================================================================= //=======================================================================
//function : ExtremeFaces //function : ExtremeFaces
//purpose : Calcul des faces d'appui de la nervure //purpose : Calculate the base faces of the rib
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib, Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
@ -1130,7 +1130,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
NumberOfEdges++; NumberOfEdges++;
} }
// ---Le wire comporte 1 seul edge // ---the wire includes only one edge
if(NumberOfEdges == 1) { if(NumberOfEdges == 1) {
#ifdef DEB #ifdef DEB
if (trc) cout << " One Edge" << endl; if (trc) cout << " One Edge" << endl;
@ -1139,7 +1139,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
Standard_Real f, l;//, f1, l1, temp; Standard_Real f, l;//, f1, l1, temp;
gp_Pnt firstpoint, lastpoint; gp_Pnt firstpoint, lastpoint;
// Points limite de l`unique edge // Points limit the unique edge
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
Handle(Geom_Curve) cc = BRep_Tool::Curve(E, f, l); Handle(Geom_Curve) cc = BRep_Tool::Curve(E, f, l);
gp_Pnt p1 = BRep_Tool::Pnt(TopExp::FirstVertex(E,Standard_True)); gp_Pnt p1 = BRep_Tool::Pnt(TopExp::FirstVertex(E,Standard_True));
@ -1148,8 +1148,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
Standard_Real FirstPar = f; Standard_Real LastPar = l; Standard_Real FirstPar = f; Standard_Real LastPar = l;
// ---Recherche si les 2 points limites de l`unique edge du wire // ---Find if 2 points limiting the unique edge of the wire
// sont sur un edge ou un vertex du shape de base // are on an edge or a vertex of the base shape
Standard_Boolean PtOnFirstVertex = Standard_False; Standard_Boolean PtOnFirstVertex = Standard_False;
Standard_Boolean PtOnLastVertex = Standard_False; Standard_Boolean PtOnLastVertex = Standard_False;
TopoDS_Vertex OnFirstVertex, OnLastVertex; TopoDS_Vertex OnFirstVertex, OnLastVertex;
@ -1162,8 +1162,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
if(PtOnFirstEdge) { if(PtOnFirstEdge) {
if (!PtOnFirstVertex) { if (!PtOnFirstVertex) {
// Recherche de FirstFace : face du shape de base contenant OnFirstEdge // Find FirstFace : face of the base shape containing OnFirstEdge
// satisfaisant ChoiceOfFaces // meeting ChoiceOfFaces
TopExp_Explorer ex4, ex5; TopExp_Explorer ex4, ex5;
ex4.Init(mySbase, TopAbs_FACE); ex4.Init(mySbase, TopAbs_FACE);
TopTools_ListOfShape faces; TopTools_ListOfShape faces;
@ -1186,8 +1186,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
} }
} }
else if(PtOnFirstVertex) { else if(PtOnFirstVertex) {
// Recherche de FirstFace : face du shape de base contenant OnFirstVertex // Find FirstFace : face of the base shape containing OnFirstVertex
// satisfaisant ChoiceOfFaces // meeting ChoiceOfFaces
TopExp_Explorer ex4, ex5; TopExp_Explorer ex4, ex5;
ex4.Init(mySbase, TopAbs_FACE); ex4.Init(mySbase, TopAbs_FACE);
TopTools_ListOfShape faces; TopTools_ListOfShape faces;
@ -1218,8 +1218,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
if(PtOnLastEdge) { if(PtOnLastEdge) {
if (!PtOnLastVertex) { if (!PtOnLastVertex) {
// Recherche de LastFace : face du shape de base contenant OnLastEdge // Find LastFace : face of the base shape containing OnLastEdge
// satisfaisant ChoiceOfFaces // meeting ChoiceOfFaces
TopExp_Explorer ex4, ex5; TopExp_Explorer ex4, ex5;
ex4.Init(mySbase, TopAbs_FACE); ex4.Init(mySbase, TopAbs_FACE);
TopTools_ListOfShape faces; TopTools_ListOfShape faces;
@ -1243,8 +1243,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
} }
} }
else if(PtOnLastEdge && PtOnLastVertex) { else if(PtOnLastEdge && PtOnLastVertex) {
// Recherche de LastFace : face du shape de base contenant OnLastVertex // Find LastFace : face of the base shape containing OnLastVertex
// satisfaisant ChoiceOfFaces // meeting ChoiceOfFaces
TopExp_Explorer ex4, ex5; TopExp_Explorer ex4, ex5;
ex4.Init(mySbase, TopAbs_FACE); ex4.Init(mySbase, TopAbs_FACE);
TopTools_ListOfShape faces; TopTools_ListOfShape faces;
@ -1277,7 +1277,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
return Standard_True; return Standard_True;
} }
//--- On n'a pas trouve FirstFace ou LastFace //--- FirstFace or LastFace was not found
#ifdef DEB #ifdef DEB
if (trc) cout << " FirstFace or LastFace null" << endl; if (trc) cout << " FirstFace or LastFace null" << endl;
#endif #endif
@ -1354,7 +1354,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
return Data; return Data;
} }
// ---Le wire comporte plusieurs edges // ---The wire consists of several edges
else { else {
#ifdef DEB #ifdef DEB
if (trc) cout << " Multiple Edges" << endl; if (trc) cout << " Multiple Edges" << endl;
@ -1403,7 +1403,7 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
} }
} }
// ---Recherche thepoint est sur un edge ou un vertex de la face f // ---Find thepoint on an edge or a vertex of face f
PtOnEdgeVertex(RevolRib, f, thePoint, FirstVertex, LastVertex, PtOnEdgeVertex(RevolRib, f, thePoint, FirstVertex, LastVertex,
PtOnEdge,OnEdge,PtOnVertex,OnVertex); PtOnEdge,OnEdge,PtOnVertex,OnVertex);
@ -1547,8 +1547,8 @@ Standard_Boolean BRepFeat_RibSlot::ExtremeFaces(const Standard_Boolean RevolRib,
//======================================================================= //=======================================================================
//function : PtOnEdgeVertex //function : PtOnEdgeVertex
//purpose : Recherche si les 2 points limites de l`unique edge du wire //purpose : Find if 2 limit points of the unique edge of a wire
// sont sur un edge ou un vertex du shape de base // are on an edge or a vertex of the base shape
//======================================================================= //=======================================================================
void BRepFeat_RibSlot::PtOnEdgeVertex(const Standard_Boolean RevolRib, void BRepFeat_RibSlot::PtOnEdgeVertex(const Standard_Boolean RevolRib,
@ -1619,7 +1619,7 @@ void BRepFeat_RibSlot::PtOnEdgeVertex(const Standard_Boolean RevolRib,
//======================================================================= //=======================================================================
//function : SlidingProfile //function : SlidingProfile
//purpose : construction de la face profil en cas de glissement //purpose : construction of the profile face in case of sliding
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof, Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
@ -1642,9 +1642,9 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
if (trc) cout << "BRepFeat_RibSlot::SlidingProfile" << endl; if (trc) cout << "BRepFeat_RibSlot::SlidingProfile" << endl;
#endif #endif
Standard_Boolean ProfileOK = Standard_True; Standard_Boolean ProfileOK = Standard_True;
// --cas de glissement : construction du wire du profil // --case of sliding : construction of the wire of the profile
// -> 1 partie boite englobante + 1 partie wire // --> 1 part bounding box + 1 part wire
// attention a la compatibilite des orientations // attention to the compatibility of orientations
gp_Dir FN, LN; gp_Dir FN, LN;
BRepLib_MakeWire WW; BRepLib_MakeWire WW;
@ -1652,9 +1652,9 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
FN = Normal(FirstFace, myFirstPnt); FN = Normal(FirstFace, myFirstPnt);
LN = Normal(LastFace, myLastPnt); LN = Normal(LastFace, myLastPnt);
// Cas de la rainure (cut) <> nervure (fuse) // Case of the groove (cut) <> rib (fuse)
// -> on est dans la matiere // -> we are in the material
// -> on fait tout en 2d dans le plan de travail : plus facile // -> make everything in 2d in the working plane : easier
if(!myFuse) { if(!myFuse) {
FN = -FN; FN = -FN;
LN = -LN; LN = -LN;
@ -1681,7 +1681,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
Standard_Real par1 = ElCLib::Parameter(ln1->Lin(), myFirstPnt); Standard_Real par1 = ElCLib::Parameter(ln1->Lin(), myFirstPnt);
Standard_Real par2 = ElCLib::Parameter(ln2->Lin(), myLastPnt); Standard_Real par2 = ElCLib::Parameter(ln2->Lin(), myLastPnt);
if(par1 >= myTol || par2 >= myTol) { if(par1 >= myTol || par2 >= myTol) {
Concavite = 2; //paralelle et concave Concavite = 2; //paralel and concave
BRepLib_MakeEdge e1(myLastPnt, myFirstPnt); BRepLib_MakeEdge e1(myLastPnt, myFirstPnt);
WW.Add(e1); WW.Add(e1);
} }
@ -1700,19 +1700,19 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
} }
} }
// ---Construction de la face profil // ---Construction of the profile face
if(Concavite == 1) { if(Concavite == 1) {
// Si concave : on peut prolonger les premiers et dernier edges du wire // if concave : it is possible to extend first and last edges of the wire
// jusque boite englobante // to the bounding box
BRepLib_MakeEdge e1(myLastPnt, Pt); BRepLib_MakeEdge e1(myLastPnt, Pt);
WW.Add(e1); WW.Add(e1);
BRepLib_MakeEdge e2(Pt, myFirstPnt); BRepLib_MakeEdge e2(Pt, myFirstPnt);
WW.Add(e2); WW.Add(e2);
} }
else if(Concavite == 3) { else if(Concavite == 3) {
// BndEdge : edges d'intersection avce la boite englobante // BndEdge : edges of intersection with the bounding box
TopoDS_Edge BndEdge1, BndEdge2; TopoDS_Edge BndEdge1, BndEdge2;
// Points d'intersection boite englobante / Profil recherche // Points of intersection with the bounding box / Find Profile
gp_Pnt BndPnt1, BndPnt2, LastPnt; gp_Pnt BndPnt1, BndPnt2, LastPnt;
TopExp_Explorer expl; TopExp_Explorer expl;
expl.Init(BndFace, TopAbs_WIRE); expl.Init(BndFace, TopAbs_WIRE);
@ -1767,7 +1767,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
WW.Add(e1); WW.Add(e1);
if(BndEdge1.IsSame(BndEdge2)) { if(BndEdge1.IsSame(BndEdge2)) {
// Cas particulier : meme edge -> cheminement simple a determiner // Particular case : same edge -> simply determined path
BRepLib_MakeEdge e2(BndPnt1, BndPnt2); BRepLib_MakeEdge e2(BndPnt1, BndPnt2);
WW.Add(e2); WW.Add(e2);
BRepLib_MakeEdge e3(BndPnt2, myFirstPnt); BRepLib_MakeEdge e3(BndPnt2, myFirstPnt);
@ -1799,9 +1799,9 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
} }
else explo.Init(BndWire); else explo.Init(BndWire);
// On controle si on est dans BndEdge2 // Check if this is BndEdge2
// -> si oui : il faut tourner pour rejoindre FirstPnt // -> if yes : it is required to turn to join FirstPnt
// -> si non : on ajoute les edges // -> if no : add edges
Standard_Boolean Fin = Standard_False; Standard_Boolean Fin = Standard_False;
while(!Fin) { while(!Fin) {
const TopoDS_Edge& e = TopoDS::Edge(explo.Current()); const TopoDS_Edge& e = TopoDS::Edge(explo.Current());
@ -1813,8 +1813,8 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
LastPnt = pp; LastPnt = pp;
} }
else { else {
// le chemin est ferme // the path is closed
// -> des que l'on recontre BndEdge2, fin des bords sur BndFace // -> since met BndEdge2, end of borders on BndFace
Fin = Standard_True; Fin = Standard_True;
BRepLib_MakeEdge ee(LastPnt, BndPnt2); BRepLib_MakeEdge ee(LastPnt, BndPnt2);
WW.Add(ee); WW.Add(ee);
@ -1834,10 +1834,10 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
} }
} }
// ---Construction du profil // ---Construction of the profile
// On explore le wire fourni par l'utilisateur // Explore the wire provided by the user
// BRepTools_WireExplorer : bon ordre - sans repetition <> TopExp : non ordonne // BRepTools_WireExplorer : correct order - without repetition <> TopExp : non ordered
BRepTools_WireExplorer EX(myWire); BRepTools_WireExplorer EX(myWire);
Standard_Real ff, ll; Standard_Real ff, ll;
@ -1867,7 +1867,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
WW.Add(el); WW.Add(el);
} }
else { else {
// 1 seul edge : traitement particulier // only one edge : particular processing
Standard_Real fpar = IntPar(FirstCurve, myFirstPnt); Standard_Real fpar = IntPar(FirstCurve, myFirstPnt);
Standard_Real lpar = IntPar(FirstCurve, myLastPnt); Standard_Real lpar = IntPar(FirstCurve, myLastPnt);
Handle(Geom_Curve) c; Handle(Geom_Curve) c;
@ -1892,19 +1892,19 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
} }
if(Concavite != 3) { if(Concavite != 3) {
// Si concave : fac est OK // if concave : face is OK
Prof = fac; Prof = fac;
} }
else { else {
// Si non concave // if not concave
// CheckPnt : point legerement a l'interieur cote matiere // CheckPnt : point slightly inside the material side
// Bndface : face/coupe de la boite englobante dans le plen du profil // Bndface : face/cut of the bounding box in the plane of the profile
BRepTopAdaptor_FClass2d Cl(fac, BRep_Tool::Tolerance(fac)); BRepTopAdaptor_FClass2d Cl(fac, BRep_Tool::Tolerance(fac));
Standard_Real u, v; Standard_Real u, v;
ElSLib::Parameters(myPln->Pln(), CheckPnt, u, v); ElSLib::Parameters(myPln->Pln(), CheckPnt, u, v);
gp_Pnt2d checkpnt2d(u, v); gp_Pnt2d checkpnt2d(u, v);
if(Cl.Perform(checkpnt2d, Standard_True) == TopAbs_OUT) { if(Cl.Perform(checkpnt2d, Standard_True) == TopAbs_OUT) {
// Si fac n'est pas le bon morceau de BndFace on prend le complementaire // If face is not the correct part of BndFace take the complementary
//modified by NIZNHY-PKV Fri Mar 22 16:46:20 2002 f //modified by NIZNHY-PKV Fri Mar 22 16:46:20 2002 f
//BRepAlgo_Cut c(BndFace, fac); //BRepAlgo_Cut c(BndFace, fac);
BRepAlgoAPI_Cut c(BndFace, fac); BRepAlgoAPI_Cut c(BndFace, fac);
@ -1915,7 +1915,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
Prof = TopoDS::Face(ffx.Shape()); Prof = TopoDS::Face(ffx.Shape());
} }
else { else {
// Si fac est le bon morceau de BndFace : fac est OK // If face is the correct part of BndFace : face is OK
Prof = fac; Prof = fac;
} }
} }
@ -1931,7 +1931,7 @@ Standard_Boolean BRepFeat_RibSlot::SlidingProfile(TopoDS_Face& Prof,
} }
//======================================================================= //=======================================================================
//function : NoSlidingProfile //function : NoSlidingProfile
//purpose : construction de la face profil en cas de glissement //purpose : construction of the face profile in case of sliding
//======================================================================= //=======================================================================
Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof, Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
@ -1995,7 +1995,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
Standard_Real par1 = ElCLib::Parameter(firstln->Lin(), myFirstPnt); Standard_Real par1 = ElCLib::Parameter(firstln->Lin(), myFirstPnt);
Standard_Real par2 = ElCLib::Parameter(lastln->Lin(), myLastPnt); Standard_Real par2 = ElCLib::Parameter(lastln->Lin(), myLastPnt);
if(par1 >= myTol || par2 >= myTol) if(par1 >= myTol || par2 >= myTol)
Concavite = 2; //paralelle et concave Concavite = 2; //parallel and concave
} }
if(d1.IsEqual(d2, myTol)) { if(d1.IsEqual(d2, myTol)) {
if(Concavite == 3) TestOK = Standard_False; if(Concavite == 3) TestOK = Standard_False;
@ -2011,7 +2011,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
} }
} }
// ---Construction de la face profil // ---Construction of the face profile
if(Concavite == 3) { if(Concavite == 3) {
if(OnFirstFace) { if(OnFirstFace) {
Standard_Real f, l; Standard_Real f, l;
@ -2327,7 +2327,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
if(!theLastEdge.IsNull()) { if(!theLastEdge.IsNull()) {
const TopoDS_Vertex& v1 = TopExp::LastVertex(theLastEdge,Standard_True); const TopoDS_Vertex& v1 = TopExp::LastVertex(theLastEdge,Standard_True);
TopoDS_Vertex v2; TopoDS_Vertex v2;
// Attention cas Wire Reversed -> LastVertex sans Standard_True // Attention case Wire Reversed -> LastVertex without Standard_True
const gp_Pnt& pp = BRep_Tool::Pnt(TopExp::LastVertex(FirstEdge)); const gp_Pnt& pp = BRep_Tool::Pnt(TopExp::LastVertex(FirstEdge));
if(!theFV.IsNull() && theFirstpoint.Distance(pp) <= myTol) { if(!theFV.IsNull() && theFirstpoint.Distance(pp) <= myTol) {
v2 = theFV; v2 = theFV;
@ -2670,7 +2670,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the belonging to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
// const TopoDS_Shape& sh = itm.Key(); // const TopoDS_Shape& sh = itm.Key();
@ -2727,7 +2727,7 @@ Standard_Boolean BRepFeat_RibSlot::NoSlidingProfile(TopoDS_Face& Prof,
} }
myMap.ChangeFind(orig).Clear(); myMap.ChangeFind(orig).Clear();
for (itm.Initialize(newdsc); itm.More(); itm.Next()) { for (itm.Initialize(newdsc); itm.More(); itm.Next()) {
// on verifie l`appartenance au shape... // check the belonging to the shape...
for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) { for (exp.Init(S,TopAbs_FACE);exp.More();exp.Next()) {
if (exp.Current().IsSame(itm.Key())) { if (exp.Current().IsSame(itm.Key())) {
// const TopoDS_Shape& sh = itm.Key(); // const TopoDS_Shape& sh = itm.Key();

View File

@ -55,7 +55,7 @@ Standard_Boolean BRepFeat_SplitShape::IsDeleted(const TopoDS_Shape& F)
{ {
TopTools_ListIteratorOfListOfShape itl TopTools_ListIteratorOfListOfShape itl
(((LocOpe_Spliter*) &mySShape)->DescendantShapes(F)); (((LocOpe_Spliter*) &mySShape)->DescendantShapes(F));
// tout ceci pour truander le const // all that to swindle the constant
return (!itl.More());// a priori impossible return (!itl.More());// a priori impossible

View File

@ -5,28 +5,28 @@
// Modified: Mon Jan 12 10:50:10 1998 // Modified: Mon Jan 12 10:50:10 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// gestion automatique de l'origine et de l'orientation // automatic management of origin and orientation
// avec la methode Organize // with method Organize
// Modified: Mon Feb 23 09:28:46 1998 // Modified: Mon Feb 23 09:28:46 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// methode Organize avec option de projection pour les wires fermes // method Organize with option of projection for closed wires
// nouvelle methode SameNumber avec option de report des decoupes // new method SameNumber with option to report cuts
// + utilitaires ComputeACR et InsertACR // + utilities ComputeACR and InsertACR
// + traitement du cas derniere section ponctuelle // + processing of the case of last point section
// Modified: Thu Apr 30 15:24:17 1998 // Modified: Thu Apr 30 15:24:17 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// separation sections fermees / sections ouvertes + debug // separation closed / open sections + debug
// Organize devient ComputeOrigin et SearchOrigin // Organize becomes ComputeOrigin and SearchOrigin
// Modified: Tue Jul 21 16:48:35 1998 // Modified: Tue Jul 21 16:48:35 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// cas limite pour Pnext d'ou vrillage (BUC60281) // limited case for Pnext of a twist (BUC60281)
// Modified: Thu Jul 23 11:38:36 1998 // Modified: Thu Jul 23 11:38:36 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// calcul de l'angle de la rotation dans SearchOrigin // calculate the angle of rotation in SearchOrigin
// Modified: Fri Jul 31 15:14:19 1998 // Modified: Fri Jul 31 15:14:19 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
@ -34,7 +34,7 @@
// Modified: Mon Oct 12 09:42:33 1998 // Modified: Mon Oct 12 09:42:33 1998
// Author: Joelle CHAUVET // Author: Joelle CHAUVET
// <jct@sgi64> // <jct@sgi64>
// numero des aretes dans EdgesFromVertex (CTS21570) // number of edges in EdgesFromVertex (CTS21570)
#include <BRepFill.ixx> #include <BRepFill.ixx>
@ -167,11 +167,11 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
Vbid.Nullify(); Vbid.Nullify();
if (SeqOrder) { if (SeqOrder) {
// de first vers last // from first to last
m0 = first; m0 = first;
V0 = Vf; V0 = Vf;
for (j=1; j<=ndec; j++) { for (j=1; j<=ndec; j++) {
// morceau d'edge // piece of edge
m1 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first; m1 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
TopoDS_Edge CutE = BRepLib_MakeEdge(C,V0,Vbid,m0,m1); TopoDS_Edge CutE = BRepLib_MakeEdge(C,V0,Vbid,m0,m1);
CutE.Orientation(CurrentOrient); CutE.Orientation(CurrentOrient);
@ -179,7 +179,7 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
m0 = m1; m0 = m1;
V0 = TopExp::LastVertex(CutE); V0 = TopExp::LastVertex(CutE);
if (j==ndec) { if (j==ndec) {
// dernier morceau // last piece
TopoDS_Edge LastE = BRepLib_MakeEdge(C,V0,Vl,m0,last); TopoDS_Edge LastE = BRepLib_MakeEdge(C,V0,Vl,m0,last);
LastE.Orientation(CurrentOrient); LastE.Orientation(CurrentOrient);
S.Append(LastE); S.Append(LastE);
@ -187,11 +187,11 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
} }
} }
else { else {
// de last vers first // from last to first
m1 = last; m1 = last;
V1 = Vl; V1 = Vl;
for (j=ndec; j>=1; j--) { for (j=ndec; j>=1; j--) {
// morceau d'edge // piece of edge
m0 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first; m0 = (CutValues.Value(j)-t0)*(last-first)/(t1-t0)+first;
TopoDS_Edge CutE = BRepLib_MakeEdge(C,Vbid,V1,m0,m1); TopoDS_Edge CutE = BRepLib_MakeEdge(C,Vbid,V1,m0,m1);
CutE.Orientation(CurrentOrient); CutE.Orientation(CurrentOrient);
@ -199,7 +199,7 @@ static void TrimEdge (const TopoDS_Edge& CurrentEdge,
m1 = m0; m1 = m0;
V1 = TopExp::FirstVertex(CutE); V1 = TopExp::FirstVertex(CutE);
if (j==1) { if (j==1) {
// dernier morceau // last piece
TopoDS_Edge LastE = BRepLib_MakeEdge(C,Vf,V1,first,m1); TopoDS_Edge LastE = BRepLib_MakeEdge(C,Vf,V1,first,m1);
LastE.Orientation(CurrentOrient); LastE.Orientation(CurrentOrient);
S.Append(LastE); S.Append(LastE);
@ -243,7 +243,7 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
TopoDS_Vertex V1f,V1l,V2f,V2l; TopoDS_Vertex V1f,V1l,V2f,V2l;
// on cree un new Handle // create a new Handle
if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() || if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() ||
Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) { Abs(l1 - C1->LastParameter()) > Precision::PConfusion() ) {
C1 = new Geom_TrimmedCurve(C1,f1,l1); C1 = new Geom_TrimmedCurve(C1,f1,l1);
@ -251,11 +251,11 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
else { else {
C1 = Handle(Geom_Curve)::DownCast(C1->Copy()); C1 = Handle(Geom_Curve)::DownCast(C1->Copy());
} }
// eventuellement on bouge la courbe // eventually the curve is concerned
if ( !SameLoc) { if ( !SameLoc) {
C1->Transform(L1.Transformation()); C1->Transform(L1.Transformation());
} }
// on la met dans le bon sens et on prend ses vertex // it is set in the proper direction and its vertices are taken
if (Edge1.Orientation() == TopAbs_REVERSED) { if (Edge1.Orientation() == TopAbs_REVERSED) {
TopExp::Vertices(Edge1,V1l,V1f); TopExp::Vertices(Edge1,V1l,V1f);
C1->Reverse(); C1->Reverse();
@ -264,7 +264,7 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
TopExp::Vertices(Edge1,V1f,V1l); TopExp::Vertices(Edge1,V1f,V1l);
} }
// on cree un new Handle // a new Handle is created
if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() || if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() ||
Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) { Abs(l2 - C2->LastParameter()) > Precision::PConfusion() ) {
C2 = new Geom_TrimmedCurve(C2,f2,l2); C2 = new Geom_TrimmedCurve(C2,f2,l2);
@ -272,11 +272,11 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
else { else {
C2 = Handle(Geom_Curve)::DownCast(C2->Copy()); C2 = Handle(Geom_Curve)::DownCast(C2->Copy());
} }
// eventuellement on bouge la courbe // eventually the curve is concerned
if ( !SameLoc) { if ( !SameLoc) {
C2->Transform(L2.Transformation()); C2->Transform(L2.Transformation());
} }
// on la met dans le bon sens et on prend ses vertex // it is set in the proper direction and its vertices are taken
if (Edge2.Orientation() == TopAbs_REVERSED) { if (Edge2.Orientation() == TopAbs_REVERSED) {
TopExp::Vertices(Edge2,V2l,V2f); TopExp::Vertices(Edge2,V2l,V2f);
C2->Reverse(); C2->Reverse();
@ -285,7 +285,7 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1,
TopExp::Vertices(Edge2,V2f,V2l); TopExp::Vertices(Edge2,V2f,V2l);
} }
// Sont-ce des edges fermes // Are they closed edges?
Standard_Boolean Closed = V1f.IsSame(V1l) && V2f.IsSame(V2l); Standard_Boolean Closed = V1f.IsSame(V1l) && V2f.IsSame(V2l);
@ -642,7 +642,7 @@ void BRepFill::Axe (const TopoDS_Shape& Spine,
TopoDS_Face aFace; TopoDS_Face aFace;
// normale au Spine. // normal to the Spine.
if (Spine.ShapeType() == TopAbs_FACE) { if (Spine.ShapeType() == TopAbs_FACE) {
aFace = TopoDS::Face(Spine); aFace = TopoDS::Face(Spine);
S = BRep_Tool::Surface(TopoDS::Face(Spine), L); S = BRep_Tool::Surface(TopoDS::Face(Spine), L);
@ -670,7 +670,7 @@ void BRepFill::Axe (const TopoDS_Shape& Spine,
Normal = Handle(Geom_Plane)::DownCast(S)->Pln().Axis().Direction(); Normal = Handle(Geom_Plane)::DownCast(S)->Pln().Axis().Direction();
// Recherche du vertex du profil le plus proche du spine. // Find vertex of the profile closest to the spine.
Standard_Real DistMin = Precision::Infinite(); Standard_Real DistMin = Precision::Infinite();
Standard_Real Dist; Standard_Real Dist;
// Standard_Real Tol2 = Tol*Tol; // Standard_Real Tol2 = Tol*Tol;
@ -681,7 +681,7 @@ void BRepFill::Axe (const TopoDS_Shape& Spine,
// Standard_Real D1,D2; // Standard_Real D1,D2;
gp_Pnt P1,P2; gp_Pnt P1,P2;
// On cherche d'abord si il y a contact Vertex Vertex. // First check if there is contact Vertex Vertex.
Standard_Boolean IsOnVertex = Standard_False; Standard_Boolean IsOnVertex = Standard_False;
SE.Init(aFace.Oriented(TopAbs_FORWARD),TopAbs_VERTEX); SE.Init(aFace.Oriented(TopAbs_FORWARD),TopAbs_VERTEX);
// modified by NIZHNY-EAP Wed Feb 23 12:31:52 2000 ___BEGIN___ // modified by NIZHNY-EAP Wed Feb 23 12:31:52 2000 ___BEGIN___
@ -780,7 +780,7 @@ void BRepFill::Axe (const TopoDS_Shape& Spine,
} }
} }
} }
// sauvegarde minimum. // save minimum.
if (Dist < DistMin) { if (Dist < DistMin) {
DistMin = Dist; DistMin = Dist;
BRepAdaptor_Curve BAC(E); BRepAdaptor_Curve BAC(E);
@ -800,7 +800,7 @@ void BRepFill::Axe (const TopoDS_Shape& Spine,
//======================================================================= //=======================================================================
//function : SearchOrigin //function : SearchOrigin
//purpose : Decoupe et oriente un wire ferme. //purpose : Cut and orientate a closed wire.
//======================================================================= //=======================================================================
void BRepFill::SearchOrigin(TopoDS_Wire & W, void BRepFill::SearchOrigin(TopoDS_Wire & W,
@ -821,9 +821,9 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
// Class BRep_Tool without fields and without Constructor : // Class BRep_Tool without fields and without Constructor :
// BRep_Tool BT; // BRep_Tool BT;
W.Orientation(TopAbs_FORWARD); //pour ne pas composer les orientations W.Orientation(TopAbs_FORWARD); //to avoid composing the orientations
// Calcul la distance // Calculate the distance
B.MakeVertex(V, P, Tol); B.MakeVertex(V, P, Tol);
BRepExtrema_DistShapeShape DSS(V, W); BRepExtrema_DistShapeShape DSS(V, W);
if (DSS.IsDone()) { if (DSS.IsDone()) {
@ -870,14 +870,14 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
Standard_Boolean forward; Standard_Boolean forward;
BRepTools_WireExplorer exp; BRepTools_WireExplorer exp;
// Calcul le nombre d'edges // Calculate the number of edges
for(exp.Init(W); exp.More(); exp.Next()) NbEdges++; for(exp.Init(W); exp.More(); exp.Next()) NbEdges++;
if (NewVertex) { if (NewVertex) {
NbEdges++; NbEdges++;
Eref = E; Eref = E;
} }
// Construit la Table et calcul rangdeb // Construct the Table and calculate rangdeb
TopTools_Array1OfShape Edges(1, NbEdges); TopTools_Array1OfShape Edges(1, NbEdges);
for(exp.Init(W), ii=1; exp.More(); exp.Next(), ii++) { for(exp.Init(W), ii=1; exp.More(); exp.Next(), ii++) {
E = exp.Current(); E = exp.Current();
@ -898,7 +898,7 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
} }
if (rangdeb == 0) rangdeb = NbEdges; if (rangdeb == 0) rangdeb = NbEdges;
// Calcul du sens de parcourt // Calculate the direction of parsing
E = TopoDS::Edge(Edges(rangdeb)); E = TopoDS::Edge(Edges(rangdeb));
if (!NewVertex) { if (!NewVertex) {
// theparam = BT.Parameter(V, E); // theparam = BT.Parameter(V, E);
@ -930,11 +930,11 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W,
void BRepFill::ComputeACR(const TopoDS_Wire& wire, void BRepFill::ComputeACR(const TopoDS_Wire& wire,
TColStd_Array1OfReal& ACR) TColStd_Array1OfReal& ACR)
{ {
// calcul des abscisses curvilignes reduites et de la longueur du wire // calculate the reduced curvilinear abscisses and the length of the wire
BRepTools_WireExplorer anExp; BRepTools_WireExplorer anExp;
Standard_Integer nbEdges=0, i; Standard_Integer nbEdges=0, i;
// longueurs cumulees // cumulated lengths
ACR.Init(0); ACR.Init(0);
for(anExp.Init(wire); anExp.More(); anExp.Next()) { for(anExp.Init(wire); anExp.More(); anExp.Next()) {
nbEdges++; nbEdges++;
@ -946,17 +946,17 @@ void BRepFill::ComputeACR(const TopoDS_Wire& wire,
} }
} }
// longueur totale du wire // total length of the wire
ACR(0) = ACR(nbEdges); ACR(0) = ACR(nbEdges);
// abscisses curvilignes reduites // reduced curvilinear abscisses
if (ACR(0)>Precision::Confusion()) { if (ACR(0)>Precision::Confusion()) {
for (i=1; i<=nbEdges; i++) { for (i=1; i<=nbEdges; i++) {
ACR(i) /= ACR(0); ACR(i) /= ACR(0);
} }
} }
else { else {
// wire ponctuel // punctual wire
ACR(nbEdges) = 1; ACR(nbEdges) = 1;
} }
@ -971,7 +971,7 @@ TopoDS_Wire BRepFill::InsertACR(const TopoDS_Wire& wire,
const TColStd_Array1OfReal& ACRcuts, const TColStd_Array1OfReal& ACRcuts,
const Standard_Real prec) const Standard_Real prec)
{ {
// calcul des ACR du wire a decouper // calculate ACR of the wire to be cut
BRepTools_WireExplorer anExp; BRepTools_WireExplorer anExp;
Standard_Integer nbEdges=0; Standard_Integer nbEdges=0;
for(anExp.Init(wire); anExp.More(); anExp.Next()) { for(anExp.Init(wire); anExp.More(); anExp.Next()) {
@ -987,13 +987,13 @@ TopoDS_Wire BRepFill::InsertACR(const TopoDS_Wire& wire,
Standard_Real t0,t1=0; Standard_Real t0,t1=0;
nbEdges=0; nbEdges=0;
// traitement edge par edge // processing edge by edge
for(anExp.Init(wire); anExp.More(); anExp.Next()) { for(anExp.Init(wire); anExp.More(); anExp.Next()) {
nbEdges++; nbEdges++;
t0 = t1; t0 = t1;
t1 = ACRwire(nbEdges); t1 = ACRwire(nbEdges);
// parametres de decoupe sur cette edge // parameters of cut on this edge
Standard_Integer ndec=0; Standard_Integer ndec=0;
for (i=1; i<=ACRcuts.Length(); i++ ) { for (i=1; i<=ACRcuts.Length(); i++ ) {
if (t0+prec<ACRcuts(i) && ACRcuts(i)<t1-prec) { if (t0+prec<ACRcuts(i) && ACRcuts(i)<t1-prec) {
@ -1006,19 +1006,19 @@ TopoDS_Wire BRepFill::InsertACR(const TopoDS_Wire& wire,
TopoDS_Vertex V = anExp.CurrentVertex(); TopoDS_Vertex V = anExp.CurrentVertex();
if (ndec==0 || BRep_Tool::Degenerated(E)) { if (ndec==0 || BRep_Tool::Degenerated(E)) {
// on copie l'edge // copy the edge
MW.Add(E); MW.Add(E);
} }
else { else {
// il faut couper l'edge // it is necessary to cut the edge
// en respectant le sens de parcours du wire // following the direction of parsing of the wire
Standard_Boolean SO = (V.IsSame(TopExp::FirstVertex(E))); Standard_Boolean SO = (V.IsSame(TopExp::FirstVertex(E)));
TopTools_SequenceOfShape SE; TopTools_SequenceOfShape SE;
SE.Clear(); SE.Clear();
TColStd_SequenceOfReal SR; TColStd_SequenceOfReal SR;
SR.Clear(); SR.Clear();
// le wire est toujours FORWARD // the wire is always FORWARD
// il faut modifier le parametre de decoupe si l'edge est REVERSED // it is necesary to modify the parameter of cut6 if the edge is REVERSED
if (E.Orientation() == TopAbs_FORWARD) { if (E.Orientation() == TopAbs_FORWARD) {
for (j=1; j<=ndec; j++) SR.Append(paradec(j)); for (j=1; j<=ndec; j++) SR.Append(paradec(j));
} }
@ -1032,7 +1032,7 @@ TopoDS_Wire BRepFill::InsertACR(const TopoDS_Wire& wire,
} }
} }
// resultat // result
TopAbs_Orientation Orien = wire.Orientation(); TopAbs_Orientation Orien = wire.Orientation();
TopoDS_Shape aLocalShape = MW.Wire(); TopoDS_Shape aLocalShape = MW.Wire();
aLocalShape.Orientation(Orien); aLocalShape.Orientation(Orien);

View File

@ -7,10 +7,9 @@
class ACRLaw from BRepFill inherits LocationLaw from BRepFill class ACRLaw from BRepFill inherits LocationLaw from BRepFill
---Purpose: Build Location Law, with a Wire. dans le cas du ---Purpose: Build Location Law, with a Wire. In the case
-- contour guide et triedre par Abscisse Curviligne -- of guided contour and trihedron by reduced
-- Reduite -- curvilinear abscissa
--

View File

@ -27,12 +27,12 @@ BRepFill_ACRLaw::BRepFill_ACRLaw(const TopoDS_Wire& Path,
{ {
Init(Path); Init(Path);
// calcul du nb d'edge du path // calculate the nb of edge of the path
BRepTools_WireExplorer wexp; BRepTools_WireExplorer wexp;
Standard_Integer NbEdge = 0; Standard_Integer NbEdge = 0;
for (wexp.Init(myPath); wexp.More(); wexp.Next()) NbEdge++; for (wexp.Init(myPath); wexp.More(); wexp.Next()) NbEdge++;
// tab pour memoriser les ACR pour chaque edge // tab to memorize ACR for each edge
OrigParam = new (TColStd_HArray1OfReal)(0,NbEdge); OrigParam = new (TColStd_HArray1OfReal)(0,NbEdge);
TColStd_Array1OfReal Orig (0,NbEdge); TColStd_Array1OfReal Orig (0,NbEdge);
BRepFill::ComputeACR(Path, Orig); BRepFill::ComputeACR(Path, Orig);
@ -46,12 +46,12 @@ BRepFill_ACRLaw::BRepFill_ACRLaw(const TopoDS_Wire& Path,
Handle(GeomAdaptor_HCurve) AC; Handle(GeomAdaptor_HCurve) AC;
Standard_Real First, Last; Standard_Real First, Last;
// on recupere les ACR des edges de la trajectoire // return ACR of edges of the trajectory
OrigParam->SetValue(0,0); OrigParam->SetValue(0,0);
for (ipath=1;ipath<=NbEdge;ipath++) for (ipath=1;ipath<=NbEdge;ipath++)
OrigParam->SetValue(ipath, Orig(ipath)); OrigParam->SetValue(ipath, Orig(ipath));
// on traite chaque edge de la trajectoire // process each edge of the trajectory
for (ipath=0, wexp.Init(myPath); for (ipath=0, wexp.Init(myPath);
wexp.More(); wexp.Next()) { wexp.More(); wexp.Next()) {
E = wexp.Current(); E = wexp.Current();
@ -64,14 +64,14 @@ BRepFill_ACRLaw::BRepFill_ACRLaw(const TopoDS_Wire& Path,
if (Or == TopAbs_REVERSED) { if (Or == TopAbs_REVERSED) {
Handle(Geom_TrimmedCurve) CBis = Handle(Geom_TrimmedCurve) CBis =
new (Geom_TrimmedCurve) (C, First, Last); new (Geom_TrimmedCurve) (C, First, Last);
CBis->Reverse(); // Pour eviter de deteriorer la topologie CBis->Reverse(); // To avoid damaging the topology
C = CBis; C = CBis;
First = C->FirstParameter(); First = C->FirstParameter();
Last = C->LastParameter(); Last = C->LastParameter();
} }
AC = new (GeomAdaptor_HCurve) (C, First, Last); AC = new (GeomAdaptor_HCurve) (C, First, Last);
// on Set les parametres pour le cas multi-edges // Set the parameters for the case multi-edges
Standard_Real t1 = OrigParam->Value(ipath-1); Standard_Real t1 = OrigParam->Value(ipath-1);
Standard_Real t2 = OrigParam->Value(ipath); Standard_Real t2 = OrigParam->Value(ipath);
Handle(GeomFill_LocationGuide) Loc; Handle(GeomFill_LocationGuide) Loc;

View File

@ -87,7 +87,7 @@ static void ComputeTrsf(const TopoDS_Wire& W,
Bnd_Box& Box, Bnd_Box& Box,
gp_Trsf& Tf) gp_Trsf& Tf)
{ {
// Calcul d'un barycentre approximatif // Calculate approximate barycenter
BRepTools_WireExplorer Exp(W); BRepTools_WireExplorer Exp(W);
// Class BRep_Tool without fields and without Constructor : // Class BRep_Tool without fields and without Constructor :
// BRep_Tool BT; // BRep_Tool BT;
@ -101,19 +101,19 @@ static void ComputeTrsf(const TopoDS_Wire& W,
} }
Bary /= nb; Bary /= nb;
// Calcul la Transfo // Calculate the Transformation
gp_Ax3 N(Bary, D); gp_Ax3 N(Bary, D);
Tf.SetTransformation(N); Tf.SetTransformation(N);
BRepAdaptor_Curve AC; BRepAdaptor_Curve AC;
// BndLib_Add3dCurve BC; // BndLib_Add3dCurve BC;
// transfo du wire // transformation to the wire
TopoDS_Wire TheW = W; TopoDS_Wire TheW = W;
TopLoc_Location Loc(Tf); TopLoc_Location Loc(Tf);
TheW.Location(Loc); TheW.Location(Loc);
// Calcul la boite // Calculate the box
Box.SetVoid(); Box.SetVoid();
for (Exp.Init(TheW); Exp.More(); Exp.Next()) { for (Exp.Init(TheW); Exp.More(); Exp.Next()) {
AC.Initialize(Exp.Current()); AC.Initialize(Exp.Current());
@ -123,7 +123,7 @@ static void ComputeTrsf(const TopoDS_Wire& W,
} }
//======================================================================= //=======================================================================
//function : Longueur //function : Length
//purpose : //purpose :
//====================================================================== //======================================================================
static Standard_Real Longueur(const Bnd_Box& WBox, static Standard_Real Longueur(const Bnd_Box& WBox,
@ -131,11 +131,11 @@ static Standard_Real Longueur(const Bnd_Box& WBox,
gp_Dir& D, gp_Dir& D,
gp_Pnt& P) gp_Pnt& P)
{ {
// face de la boite la plus eloignee de la face entree dans // face of the box most remoted from the face input in
//la direction de depouille // the direction of skin
Standard_Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax,WZmin,WZmax,L; Standard_Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax,WZmin,WZmax,L;
//"coord" de la boite //"coord" of the box
WBox.Get(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax); WBox.Get(Xmin,Ymin,Zmin,Xmax,Ymax,Zmax);
WZmin = Zmin; WZmin = Zmin;
WZmax = Zmax; WZmax = Zmax;
@ -144,7 +144,7 @@ static Standard_Real Longueur(const Bnd_Box& WBox,
P.SetCoord( (Xmin+Xmax)/2, (Ymin+Ymax)/2, Zmax); P.SetCoord( (Xmin+Xmax)/2, (Ymin+Ymax)/2, Zmax);
if (Zmax < WZmin) { if (Zmax < WZmin) {
// Depouille dans le mauvais sens. On inverse... // Skin in the wrong direction. Invert...
D.Reverse(); D.Reverse();
L = WZmax - Zmin; L = WZmax - Zmin;
P.SetZ(Zmin); P.SetZ(Zmin);
@ -157,8 +157,7 @@ static Standard_Real Longueur(const Bnd_Box& WBox,
//======================================================================= //=======================================================================
//function : GoodOrientation //function : GoodOrientation
//purpose : Regarde si la loi est oriente de maniere a avoir une depouille //purpose : Check if the law is oriented to have an exterior skin
// "exterieur"
//====================================================================== //======================================================================
static Standard_Boolean GoodOrientation(const Bnd_Box& B, static Standard_Boolean GoodOrientation(const Bnd_Box& B,
const Handle(BRepFill_LocationLaw)& Law, const Handle(BRepFill_LocationLaw)& Law,
@ -182,7 +181,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//#endif //#endif
r = l/Nb; r = l/Nb;
Nb++; // Nombre de points Nb++; // Number of points
TColgp_Array1OfPnt Pnts(1, Nb); TColgp_Array1OfPnt Pnts(1, Nb);
Handle(Adaptor3d_HCurve) AC; Handle(Adaptor3d_HCurve) AC;
@ -266,7 +265,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
else { else {
#if DEB #if DEB
cout << "Pas de Bords Libre !" << endl; cout << "No Free Borders !" << endl;
#endif #endif
Standard_ConstructionError::Raise("BRepFill_Draft"); Standard_ConstructionError::Raise("BRepFill_Draft");
} }
@ -276,7 +275,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
Standard_ConstructionError::Raise("BRepFill_Draft"); Standard_ConstructionError::Raise("BRepFill_Draft");
} }
// Attention aux wire closed non declare ! // Attention to closed non declared wires !
if (!myWire.Closed()) { if (!myWire.Closed()) {
TopoDS_Vertex Vf, Vl; TopoDS_Vertex Vf, Vl;
TopExp::Vertices(myWire, Vf, Vl); TopExp::Vertices(myWire, Vf, Vl);
@ -300,7 +299,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function :SetOptions //function :SetOptions
//purpose : Definit le style //purpose : Defines the style
//====================================================================== //======================================================================
void BRepFill_Draft::SetOptions(const BRepFill_TransitionStyle Style, void BRepFill_Draft::SetOptions(const BRepFill_TransitionStyle Style,
const Standard_Real Min, const Standard_Real Min,
@ -323,7 +322,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function :Perform //function :Perform
//purpose : calcul d'une surface de depouille //purpose : calculate a surface of skinning
//====================================================================== //======================================================================
void BRepFill_Draft::Perform(const Standard_Real LengthMax) void BRepFill_Draft::Perform(const Standard_Real LengthMax)
{ {
@ -341,7 +340,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function :Perform //function :Perform
//purpose : calcul d'une surface de depouille //purpose : calculate a surface of skinning
//====================================================================== //======================================================================
void BRepFill_Draft::Perform(const Handle(Geom_Surface)& Surface, void BRepFill_Draft::Perform(const Handle(Geom_Surface)& Surface,
const Standard_Boolean KeepInsideSurface) const Standard_Boolean KeepInsideSurface)
@ -353,7 +352,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
ComputeTrsf(myWire, myDir, WBox, Trsf); ComputeTrsf(myWire, myDir, WBox, Trsf);
// boite englobant la surface d'arret // box with bounds of the stop surface
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
Surf = Handle(Geom_Surface)::DownCast(Surface->Transformed(Trsf)); Surf = Handle(Geom_Surface)::DownCast(Surface->Transformed(Trsf));
GeomAdaptor_Surface S1 (Surf); GeomAdaptor_Surface S1 (Surf);
@ -361,20 +360,20 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
// AS.Add(S1, 0.1, SBox); // AS.Add(S1, 0.1, SBox);
BndLib_AddSurface::Add(S1, 0.1, SBox); BndLib_AddSurface::Add(S1, 0.1, SBox);
// on calcule la longueur maximum de la regle. // calculate the maximum length of the rule.
L = Longueur(WBox, SBox, myDir, Pt); L = Longueur(WBox, SBox, myDir, Pt);
L /= Abs(Cos(myAngle)); L /= Abs(Cos(myAngle));
// Constructuion // Construction
Init(Surface, L, WBox); Init(Surface, L, WBox);
BuildShell(Surface, !KeepInsideSurface); BuildShell(Surface, !KeepInsideSurface);
Sewing(); Sewing();
} }
//======================================================================= //================================================================
//function :Perform //function :Perform
//purpose : calcul de la surface de depouille, arretee par une shape //purpose : calculate the surface of skinning, stopped by a shape
//====================================================================== //================================================================
void BRepFill_Draft::Perform(const TopoDS_Shape& StopShape, void BRepFill_Draft::Perform(const TopoDS_Shape& StopShape,
const Standard_Boolean KeepOutSide) const Standard_Boolean KeepOutSide)
{ {
@ -385,7 +384,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
ComputeTrsf(myWire, myDir, WBox, Trsf); ComputeTrsf(myWire, myDir, WBox, Trsf);
// boite englobant la shape d'arret // bounding box of the stop shape
Bnd_Box BSurf;//, TheBox; Bnd_Box BSurf;//, TheBox;
Standard_Real Umin, Umax, Vmin, Vmax; Standard_Real Umin, Umax, Vmin, Vmax;
#ifdef DEB #ifdef DEB
@ -400,28 +399,28 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
TopExp_Explorer Ex (StopShape, TopAbs_FACE); TopExp_Explorer Ex (StopShape, TopAbs_FACE);
SBox.SetVoid(); SBox.SetVoid();
while (Ex.More()) { // on parcourt les faces de la shape d'arret while (Ex.More()) { // parse faces of the stop shape
// B.UVBounds(TopoDS::Face(Ex.Current()), Umin,Umax,Vmin,Vmax); // B.UVBounds(TopoDS::Face(Ex.Current()), Umin,Umax,Vmin,Vmax);
BRepTools::UVBounds(TopoDS::Face(Ex.Current()), Umin,Umax,Vmin,Vmax); BRepTools::UVBounds(TopoDS::Face(Ex.Current()), Umin,Umax,Vmin,Vmax);
Surf = Handle(Geom_Surface)::DownCast( Surf = Handle(Geom_Surface)::DownCast(
// BT.Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) ); // BT.Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) );
BRep_Tool::Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) ); BRep_Tool::Surface(TopoDS::Face(Ex.Current()))->Transformed(Trsf) );
GeomAdaptor_Surface S1 (Surf); GeomAdaptor_Surface S1 (Surf);
// boite englobant la face courante // bounding box of the current face
// AS.Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf); // AS.Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf);
BndLib_AddSurface::Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf); BndLib_AddSurface::Add(S1, Umin, Umax, Vmin, Vmax, 0.1, BSurf);
SBox.Add(BSurf); // on regroupe les boites SBox.Add(BSurf); // group boxes
Ex.Next(); Ex.Next();
}// while_Ex }// while_Ex
// on calcule la longueur maximum de la regle. // calculate the maximum length of the rule.
L = Longueur(WBox, SBox, myDir, Pt); L = Longueur(WBox, SBox, myDir, Pt);
L /= Abs(Cos(myAngle)); L /= Abs(Cos(myAngle));
// surface d'arret // surface of stop
gp_Trsf Inv; gp_Trsf Inv;
Inv = Trsf.Inverted(); // transfo inverse Inv = Trsf.Inverted(); // inverted transformation
Pt.Transform(Inv); // coord dans le repere absolu Pt.Transform(Inv); // coordinate in the absolute reference
Handle(Geom_Plane) Plan = new (Geom_Plane)(Pt, myDir); Handle(Geom_Plane) Plan = new (Geom_Plane)(Pt, myDir);
Surf = new (Geom_RectangularTrimmedSurface) (Plan,-L, L, -L, L); Surf = new (Geom_RectangularTrimmedSurface) (Plan,-L, L, -L, L);
@ -433,7 +432,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
#endif #endif
// Balayage et restriction // Sweeping and restriction
Init(Plan, L*1.01, WBox); Init(Plan, L*1.01, WBox);
BuildShell(Surf, Standard_False); BuildShell(Surf, Standard_False);
Fuse(StopShape, KeepOutSide); Fuse(StopShape, KeepOutSide);
@ -442,7 +441,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function : Init //function : Init
//purpose : Construction des lois. //purpose : Construction of laws.
//====================================================================== //======================================================================
void BRepFill_Draft::Init(const Handle(Geom_Surface)& , void BRepFill_Draft::Init(const Handle(Geom_Surface)& ,
const Standard_Real Length, const Standard_Real Length,
@ -450,7 +449,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
{ {
Standard_Boolean B; Standard_Boolean B;
// loi de positionnement // law of positioning
Handle(GeomFill_LocationDraft) Loc Handle(GeomFill_LocationDraft) Loc
= new (GeomFill_LocationDraft) (myDir, myAngle); = new (GeomFill_LocationDraft) (myDir, myAngle);
myLoc = new (BRepFill_DraftLaw) (myWire, Loc); myLoc = new (BRepFill_DraftLaw) (myWire, Loc);
@ -463,14 +462,14 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
myLoc = new (BRepFill_DraftLaw) (myWire, Loc); myLoc = new (BRepFill_DraftLaw) (myWire, Loc);
} }
myLoc->CleanLaw(angmin); // Nettoie les petites discontinuites. myLoc->CleanLaw(angmin); // Clean small discontinuities.
// loi de section // law of section
// generatrice est une droite // a la binormal. // generating line is straight and parallel to binormal.
gp_Pnt P(0, 0, 0); gp_Pnt P(0, 0, 0);
gp_Vec D (0., 1., 0.); gp_Vec D (0., 1., 0.);
// Controle de l'orientation // Control of the orientation
Standard_Real f,l; Standard_Real f,l;
myLoc->Law(1)->GetDomain(f,l); myLoc->Law(1)->GetDomain(f,l);
gp_Mat M; gp_Mat M;
@ -504,12 +503,12 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function : BuildShell //function : BuildShell
//purpose : Construction de la surface de depouille //purpose : Construction of the skinning surface
//====================================================================== //======================================================================
void BRepFill_Draft::BuildShell(const Handle(Geom_Surface)& Surf, void BRepFill_Draft::BuildShell(const Handle(Geom_Surface)& Surf,
const Standard_Boolean KeepOutSide) const Standard_Boolean KeepOutSide)
{ {
// construction de la surface // construction of the surface
BRepFill_Sweep Sweep(mySec, myLoc, Standard_True); BRepFill_Sweep Sweep(mySec, myLoc, Standard_True);
Sweep.SetTolerance(myTol); Sweep.SetTolerance(myTol);
Sweep.SetAngularControl(angmin, angmax); Sweep.SetAngularControl(angmin, angmax);
@ -520,7 +519,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
myFaces = Sweep.SubShape(); myFaces = Sweep.SubShape();
mySections = Sweep.Sections(); mySections = Sweep.Sections();
myDone = Standard_True; myDone = Standard_True;
// Controle de l'orientation // Control of the orientation
Standard_Boolean out=Standard_True; Standard_Boolean out=Standard_True;
TopExp_Explorer ex(myShell,TopAbs_FACE); TopExp_Explorer ex(myShell,TopAbs_FACE);
TopoDS_Face F; TopoDS_Face F;
@ -547,10 +546,10 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
return; return;
} }
if (!Surf.IsNull()) { // On ajoute la face en bout if (!Surf.IsNull()) { // Add the face at end
// En attendant une utilisation des traces & retriction dans BRepFill_Sweep // Waiting the use of traces & retriction in BRepFill_Sweep
// On fait un Fuse. // Make Fuse.
BRepLib_MakeFace MkF; BRepLib_MakeFace MkF;
MkF.Init(Surf, Standard_True, Precision::Confusion()); MkF.Init(Surf, Standard_True, Precision::Confusion());
Fuse(MkF.Face(), KeepOutSide); Fuse(MkF.Face(), KeepOutSide);
@ -560,8 +559,8 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function : Fuse //function : Fuse
//purpose : Operation booleenne entre la depouille et //purpose : Boolean operation between the skin and the
// la shape d'arret // stop shape
//====================================================================== //======================================================================
Standard_Boolean BRepFill_Draft::Fuse(const TopoDS_Shape& StopShape, Standard_Boolean BRepFill_Draft::Fuse(const TopoDS_Shape& StopShape,
const Standard_Boolean KeepOutSide) const Standard_Boolean KeepOutSide)
@ -578,7 +577,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
else { else {
B.MakeSolid(Sol1); B.MakeSolid(Sol1);
B.Add(Sol1, myShape); // shell => solid (pour fusion) B.Add(Sol1, myShape); // shell => solid (for fusion)
} }
@ -596,7 +595,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
case TopAbs_SHELL : case TopAbs_SHELL :
{ {
B.MakeSolid(Sol2); B.MakeSolid(Sol2);
B.Add(Sol2, StopShape); // shell => solid (pour fusion) B.Add(Sol2, StopShape); // shell => solid (for fusion)
break; break;
} }
@ -606,32 +605,32 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
B.MakeShell(S); B.MakeShell(S);
B.Add(S, StopShape); B.Add(S, StopShape);
B.MakeSolid(Sol2); B.MakeSolid(Sol2);
B.Add(Sol2, S); // shell => solid (pour fusion) B.Add(Sol2, S); // shell => solid (for fusion)
break; break;
} }
default : default :
{ {
return Standard_False; // On ne sait pas faire return Standard_False; // Impossible to do
} }
} }
BRepAlgo_DSAccess DSA; BRepAlgo_DSAccess DSA;
DSA.Load(Sol1, Sol2); DSA.Load(Sol1, Sol2);
DSA.Intersect(Sol1, Sol2); // intersection des 2 solids DSA.Intersect(Sol1, Sol2); // intersection of 2 solids
// suppression des aretes correspondant aux intersections "inutiles" // removal of edges corresponding to "unused" intersections
Standard_Integer NbPaquet; Standard_Integer NbPaquet;
// gp_Pnt P1,P2; // gp_Pnt P1,P2;
TopoDS_Vertex V,V1; TopoDS_Vertex V,V1;
TopTools_ListOfShape List; TopTools_ListOfShape List;
List = DSA.GetSectionEdgeSet();// liste des aretes List = DSA.GetSectionEdgeSet();// list of edges
NbPaquet = List.Extent(); NbPaquet = List.Extent();
if (NbPaquet == 0) { if (NbPaquet == 0) {
#if DRAW #if DRAW
cout << "Pas de fusion" << endl; cout << "No fusion" << endl;
DBRep::Set("DepPart", Sol1); DBRep::Set("DepPart", Sol1);
DBRep::Set("StopPart", Sol2); DBRep::Set("StopPart", Sol2);
#endif #endif
@ -639,13 +638,13 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
if (NbPaquet > 1) { if (NbPaquet > 1) {
// Il faut selectioner les paquets. // It is required to select packs.
TColStd_Array1OfReal Dist(1, NbPaquet); TColStd_Array1OfReal Dist(1, NbPaquet);
TopTools_ListIteratorOfListOfShape it(List); TopTools_ListIteratorOfListOfShape it(List);
Standard_Real D, Dmin = 1.e10; Standard_Real D, Dmin = 1.e10;
Standard_Integer ii; Standard_Integer ii;
//On classe les paquets par eloignement. //Classify the packs by distance.
BRepExtrema_DistShapeShape Dist2; BRepExtrema_DistShapeShape Dist2;
Dist2.LoadS1( myWire ); Dist2.LoadS1( myWire );
for (ii=1; it.More();it.Next(),ii++){ for (ii=1; it.More();it.Next(),ii++){
@ -660,7 +659,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
Dist(ii) = 1.e10; Dist(ii) = 1.e10;
} }
// on supprime les edges "plus loin" que Dmin // remove edges "farther" than Dmin
for (ii=1, it.Initialize(List); it.More();it.Next(), ii++){ for (ii=1, it.Initialize(List); it.More();it.Next(), ii++){
if (Dist(ii) > Dmin) { if (Dist(ii) > Dmin) {
DSA.SuppressEdgeSet(it.Value()); DSA.SuppressEdgeSet(it.Value());
@ -674,15 +673,15 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
if (StopShape.ShapeType() != TopAbs_SOLID) { if (StopShape.ShapeType() != TopAbs_SOLID) {
// Il faut choisir le state par la geometrie // It is required to choose the state by the geometry
//(1) On recupere une edge de section //(1) Return an edge of section
List = DSA.GetSectionEdgeSet();// liste des aretes List = DSA.GetSectionEdgeSet();// list of edges
TopTools_ListIteratorOfListOfShape it(List); TopTools_ListIteratorOfListOfShape it(List);
TopoDS_Iterator iter(it.Value()); TopoDS_Iterator iter(it.Value());
TopoDS_Edge E = TopoDS::Edge(iter.Value()); TopoDS_Edge E = TopoDS::Edge(iter.Value());
// (2) On recupere sa geometrie sur StopShape //(2) Return geometry on StopShape
// Class BRep_Tool without fields and without Constructor : // Class BRep_Tool without fields and without Constructor :
// BRep_Tool BT; // BRep_Tool BT;
Handle(Geom_Surface) S; Handle(Geom_Surface) S;
@ -693,7 +692,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
// BT.CurveOnSurface(E, C2d, S, L, f, l, 2); // BT.CurveOnSurface(E, C2d, S, L, f, l, 2);
BRep_Tool::CurveOnSurface(E, C2d, S, L, f, l, 2); BRep_Tool::CurveOnSurface(E, C2d, S, L, f, l, 2);
// On Trouve une normale. // Find a normal.
C2d->D0((f+l)/2,P2d); C2d->D0((f+l)/2,P2d);
GeomLProp_SLProps SP(S, P2d.X(), P2d.Y(), 1, 1.e-12); GeomLProp_SLProps SP(S, P2d.X(), P2d.Y(), 1, 1.e-12);
if (! SP.IsNormalDefined()) { if (! SP.IsNormalDefined()) {
@ -705,17 +704,17 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
} }
// On en deduit State1 // Subtract State1
if (myDir.Angle(SP.Normal()) < PI/2) State1 = TopAbs_IN; if (myDir.Angle(SP.Normal()) < PI/2) State1 = TopAbs_IN;
else State1 = TopAbs_OUT; else State1 = TopAbs_OUT;
} }
if (! KeepOutSide) { // On inverse State2; if (! KeepOutSide) { // Invert State2;
if (State2 == TopAbs_IN) State2 = TopAbs_OUT; if (State2 == TopAbs_IN) State2 = TopAbs_OUT;
else State2 = TopAbs_IN; else State2 = TopAbs_IN;
} }
//recalcul de la shape finale //recalculate the final shape
TopoDS_Shape result = DSA.Merge(State1, State2); TopoDS_Shape result = DSA.Merge(State1, State2);
if (issolid) myShape = result; if (issolid) myShape = result;
@ -725,7 +724,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
if (Exp.More()) myShape = Exp.Current(); if (Exp.More()) myShape = Exp.Current();
} }
// Mise a jour de l'Historique // Update the History
Standard_Integer ii; Standard_Integer ii;
for (ii=1; ii<=myLoc->NbLaw(); ii++) { for (ii=1; ii<=myLoc->NbLaw(); ii++) {
const TopTools_ListOfShape& L = DSA.Modified(myFaces->Value(1,ii)); const TopTools_ListOfShape& L = DSA.Modified(myFaces->Value(1,ii));
@ -743,7 +742,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function : Sewing //function : Sewing
//purpose : Assemble la depouille avec la face du dessus //purpose : Assemble the skin with the above face
//====================================================================== //======================================================================
Standard_Boolean BRepFill_Draft::Sewing() Standard_Boolean BRepFill_Draft::Sewing()
{ {
@ -753,8 +752,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
if ((!ToAss) || (!myDone)) return Standard_False; if ((!ToAss) || (!myDone)) return Standard_False;
// Assemblage // Assembly make a shell from the faces of the shape + the input shape
// on fait un shell a partir des faces de la shape + la shape en entree
Handle(BRepBuilderAPI_Sewing) Ass = new BRepBuilderAPI_Sewing(5*myTol, Standard_True, Handle(BRepBuilderAPI_Sewing) Ass = new BRepBuilderAPI_Sewing(5*myTol, Standard_True,
Standard_True, Standard_False); Standard_True, Standard_False);
Ass->Add(myShape); Ass->Add(myShape);
@ -765,7 +763,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
Standard_Integer NbCE; Standard_Integer NbCE;
Ass->Perform(); Ass->Perform();
// On verifie que l'assemblage est effectif. // Check if the assembly is real.
NbCE = Ass->NbContigousEdges(); NbCE = Ass->NbContigousEdges();
if (NbCE > 0) { if (NbCE > 0) {
@ -780,7 +778,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
TopoDS_Iterator It(res); TopoDS_Iterator It(res);
res = It.Value(); res = It.Value();
It.Next(); It.Next();
if (!It.More()) {//Une seule partie => c'est bon if (!It.More()) {//Only one part => this is correct
myShape = res; myShape = res;
Ok = Standard_True; Ok = Standard_True;
} }
@ -788,7 +786,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
if (Ok) { if (Ok) {
// Mise a jour de l'Historique // Update the History
Standard_Integer ii; Standard_Integer ii;
for (ii=1; ii<=myLoc->NbLaw(); ii++) { for (ii=1; ii<=myLoc->NbLaw(); ii++) {
if (Ass->IsModified(myFaces->Value(1,ii))) if (Ass->IsModified(myFaces->Value(1,ii)))
@ -801,7 +799,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
Ass->Modified(mySections->Value(1,ii))); Ass->Modified(mySections->Value(1,ii)));
} }
if (myShape.Closed()) { // On fait un Solid if (myShape.Closed()) { // Make a Solid
TopoDS_Solid solid; TopoDS_Solid solid;
BRep_Builder BS; BRep_Builder BS;
BS.MakeSolid(solid); BS.MakeSolid(solid);
@ -818,14 +816,14 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
} }
} }
#if DEB #if DEB
else cout << "Draft : Pas d'assemblage !" << endl; else cout << "Draft : No assembly !" << endl;
#endif #endif
return Ok; return Ok;
} }
//======================================================================= //=======================================================================
//function : Generated //function : Generated
//purpose : retourne une sous partie partie generes par balayage //purpose : return a sub-part generated by sweeping
//====================================================================== //======================================================================
const TopTools_ListOfShape& const TopTools_ListOfShape&
BRepFill_Draft::Generated(const TopoDS_Shape& S) BRepFill_Draft::Generated(const TopoDS_Shape& S)
@ -854,17 +852,17 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
//======================================================================= //=======================================================================
//function : Shape //function : Shape
//purpose : retourne la shape complete //purpose : return the complete shape
//====================================================================== //======================================================================
TopoDS_Shape BRepFill_Draft::Shape()const TopoDS_Shape BRepFill_Draft::Shape()const
{ {
return myShape; return myShape;
} }
//======================================================================= //=====================================================================
//function : Shell //function : Shell
//purpose : surface de depouille avec la face entree (=>shell) //purpose : surface of skinning with the input face (=>shell)
//====================================================================== //=====================================================================
TopoDS_Shell BRepFill_Draft::Shell()const TopoDS_Shell BRepFill_Draft::Shell()const
{ {
return myShell; return myShell;

View File

@ -65,7 +65,7 @@ BRepFill_EdgeOnSurfLaw::BRepFill_EdgeOnSurfLaw(const TopoDS_Wire& Path,
AS = new (BRepAdaptor_HSurface) (F); AS = new (BRepAdaptor_HSurface) (F);
} }
} }
if (!Trouve) { // Impossible de construire la loi. if (!Trouve) { // Impossible to construct the law.
hasresult = Standard_False; hasresult = Standard_False;
myLaws.Nullify(); myLaws.Nullify();
return; return;
@ -75,7 +75,7 @@ BRepFill_EdgeOnSurfLaw::BRepFill_EdgeOnSurfLaw(const TopoDS_Wire& Path,
if (Or == TopAbs_REVERSED) { if (Or == TopAbs_REVERSED) {
Handle(Geom2d_TrimmedCurve) CBis = Handle(Geom2d_TrimmedCurve) CBis =
new (Geom2d_TrimmedCurve) (C, First, Last); new (Geom2d_TrimmedCurve) (C, First, Last);
CBis->Reverse(); // Pour eviter de deteriorer la topologie CBis->Reverse(); // To avoid spoiling the topology
C = CBis; C = CBis;
First = C->FirstParameter(); First = C->FirstParameter();
Last = C->LastParameter(); Last = C->LastParameter();

View File

@ -7,7 +7,7 @@
class Evolved from BRepFill class Evolved from BRepFill
---Purpose: Constructs a evolved volume from a spine (wire or face) ---Purpose: Constructs an evolved volume from a spine (wire or face)
-- and a profile ( wire). -- and a profile ( wire).
uses uses
@ -45,10 +45,10 @@ is
returns Evolved from BRepFill returns Evolved from BRepFill
---Purpose: Creates an evolved shape by sweeping the <Profile> ---Purpose: Creates an evolved shape by sweeping the <Profile>
-- along the <Spine>. <AxeProf> is used to set the -- along the <Spine>. <AxeProf> is used to set the
-- position of <Profile> along <Spine> as follow: -- position of <Profile> along <Spine> as follows:
-- l <AxeProf> glisse sur le profil avec sa -- <AxeProf> slides on the profile with direction
-- direction colineaire a la normale au <Spine>, et sa -- colinear to the normal to <Spine>, and its
-- <XDirection> confondue avec la tangente au <Spine>. -- <XDirection> mixed with the tangent to <Spine>.
-- --
raises raises
ConstructionError from Standard; ConstructionError from Standard;

File diff suppressed because it is too large Load Diff

View File

@ -2,33 +2,6 @@
// Created: Mon Mar 7 10:01:42 1994 // Created: Mon Mar 7 10:01:42 1994
// Author: Bruno DUMORTIER // Author: Bruno DUMORTIER
// <dub@fuegox> // <dub@fuegox>
// Modified: Mon Feb 23 09:28:46 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// traitement des wires ponctuels
// Modified: Tue Mar 10 17:08:58 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// suite traitement des KPart, calcul d'une BezierCurve
// au lieu d'une extraction d'iso pour Edge3 et Edge4
// Modified: Mon Apr 6 15:47:44 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// correction KPart (PRO12929)
// Modified: Thu Apr 30 15:24:17 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// debug KPart
// Modified: Fri Jul 31 15:14:19 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// KPart semi-cone pointe en bas : calcul de Edge4
//
// ajout des methodes Generated et GeneratedShapes
// Modified: Mon Nov 23 12:22:04 1998
// Author: Joelle CHAUVET
// <jct@sgi64>
// CTS21701 : orientation de l'edge dans DetectKPart
#include <BRepFill_Generator.ixx> #include <BRepFill_Generator.ixx>
@ -88,10 +61,10 @@
Standard_Integer DetectKPart(const TopoDS_Edge& Edge1, Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
const TopoDS_Edge& Edge2) const TopoDS_Edge& Edge2)
{ {
// initialisations // initializations
Standard_Integer IType = 0; Standard_Integer IType = 0;
// caracteristiques de la premiere edge // characteristics of the first edge
Standard_Real first1, last1, first2, last2, ff, ll; Standard_Real first1, last1, first2, last2, ff, ll;
TopLoc_Location loc; TopLoc_Location loc;
TopoDS_Vertex V1, V2; TopoDS_Vertex V1, V2;
@ -99,7 +72,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
GeomAdaptor_Curve AdC1; GeomAdaptor_Curve AdC1;
Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1); Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
// recherche de cas particulier // find the particular case
gp_Pnt pos1, pos; gp_Pnt pos1, pos;
Standard_Real dist; Standard_Real dist;
#ifndef DEB #ifndef DEB
@ -127,14 +100,14 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
} }
AdC1.Load(curv1); AdC1.Load(curv1);
if (AdC1.GetType() == GeomAbs_Circle) { if (AdC1.GetType() == GeomAbs_Circle) {
// premiere section circulaire // first circular section
IType = 1; IType = 1;
pos1 = AdC1.Circle().Location(); pos1 = AdC1.Circle().Location();
dist1 = AdC1.Circle().Radius(); dist1 = AdC1.Circle().Radius();
axe1 = AdC1.Circle().Axis(); axe1 = AdC1.Circle().Axis();
} }
else if (AdC1.GetType() == GeomAbs_Line) { else if (AdC1.GetType() == GeomAbs_Line) {
// premiere section rectiligne // first straight line section
IType = 4; IType = 4;
pos1 = AdC1.Line().Location(); pos1 = AdC1.Line().Location();
dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1)); dist1 = AdC1.Value(first1).Distance(AdC1.Value(last1));
@ -143,7 +116,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
axe1 = gp_Ax1(AdC1.Value(first1),dir); axe1 = gp_Ax1(AdC1.Value(first1),dir);
} }
else { else {
// premiere section quelconque // first section of any type
IType = 0; IType = 0;
} }
} }
@ -155,9 +128,9 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
TopExp::Vertices(Edge2,V1,V2); TopExp::Vertices(Edge2,V1,V2);
pos = BRep_Tool::Pnt(V1); pos = BRep_Tool::Pnt(V1);
if (IType==1) { if (IType==1) {
// seul cas particulier avec une edge degeneree en bout : le cone // the only particular case with degenerated edge at end : the cone
if (pos.IsEqual(pos1,Precision::Confusion())) { if (pos.IsEqual(pos1,Precision::Confusion())) {
// le sommet est confondu avec le centre du cercle // the top is mixed with the center of the circle
IType = 0; IType = 0;
} }
else { else {
@ -165,17 +138,17 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
gp_Dir dir(vec); gp_Dir dir(vec);
axe = gp_Ax1(pos1,dir); axe = gp_Ax1(pos1,dir);
if (axe.IsParallel(axe1,Precision::Angular())) { if (axe.IsParallel(axe1,Precision::Angular())) {
// le sommet est bien sur l'axe du cercle // the top is on the axis of the circle
IType = 2; IType = 2;
} }
else { else {
// sommet incorrect --> pas de cas particulier // incorrect top --> no particular case
IType = 0; IType = 0;
} }
} }
} }
else if (IType != 4) { //not plane else if (IType != 4) { //not a plane
// pas de cas particulier // no particular case
IType = 0; IType = 0;
} }
} }
@ -194,15 +167,15 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
if (IType>0 && IType<4) { if (IType>0 && IType<4) {
if (AdC.GetType() != GeomAbs_Circle) { if (AdC.GetType() != GeomAbs_Circle) {
// section non circulaire --> pas de cas particulier // section not circular --> no particular case
IType = 0; IType = 0;
} }
else { else {
if (AdC.Circle().Axis() if (AdC.Circle().Axis()
.IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) { .IsCoaxial(axe1,Precision::Angular(),Precision::Confusion())) {
// meme axe // same axis
if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) { if (Abs(AdC.Circle().Radius()-dist1)< Precision::Confusion()) {
// possibilite de cylindre ou de morceau de cylindre // possibility of cylinder or a piece of cylinder
Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2); Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
Standard_Boolean Same, Standard_Boolean Same,
SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() ); SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
@ -214,16 +187,16 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
Same = SameParametricLength Same = SameParametricLength
&& ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ; && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
if (Same) { if (Same) {
// cylindre ou morceau de cylindre // cylinder or piece of cylinder
IType = 1; IType = 1;
} }
else { else {
// l'intervalle de definition n'est pas correct // the interval of definition is not correct
IType = 0; IType = 0;
} }
} }
else { else {
// possibilite de tronc de cone // possibility of cone truncation
Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2); Standard_Real h1 = Abs(last1-first1), h2 = Abs(last2-first2);
Standard_Boolean Same, Standard_Boolean Same,
SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() ); SameParametricLength = ( Abs(h1-h2) < Precision::PConfusion() );
@ -235,27 +208,27 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
Same = SameParametricLength Same = SameParametricLength
&& ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ; && ( gp_Vec(P1,P2).IsNormal(DU,Precision::Angular()) ) ;
if (Same) { if (Same) {
// tronc de cone // truncation of cone
IType = 2; IType = 2;
} }
else { else {
// l'intervalle de definition n'est pas correct // the interval of definition is not correct
IType = 0; IType = 0;
} }
} }
if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) { if (AdC.Circle().Location().IsEqual(pos1,Precision::Confusion())) {
// les centres sont confondus // the centers are mixed
IType = 0; IType = 0;
} }
} }
else { else {
// axe different // different axis
if (AdC.Circle().Radius()==dist1) { if (AdC.Circle().Radius()==dist1) {
// tore ? // torus ?
IType = 3; IType = 3;
} }
else { else {
// rayon different --> pas de cas particulier // different radius --> no particular case
IType = 0; IType = 0;
} }
} }
@ -263,7 +236,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
} }
else if (IType>=4) { else if (IType>=4) {
if (AdC.GetType() != GeomAbs_Line) { if (AdC.GetType() != GeomAbs_Line) {
// section non rectiligne --> pas de cas particulier // not a straight line section --> no particular case
IType = 0; IType = 0;
} }
else { else {
@ -273,11 +246,11 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
gp_Dir dir(vec); gp_Dir dir(vec);
axe = gp_Ax1(AdC.Value(first2),dir); axe = gp_Ax1(AdC.Value(first2),dir);
if (axe.IsParallel(axe1,Precision::Angular())) { if (axe.IsParallel(axe1,Precision::Angular())) {
// droite parallele // parallel straight line
if (Abs(dist-dist1)<Precision::Confusion()) { if (Abs(dist-dist1)<Precision::Confusion()) {
gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2))); gp_Dir dir(gp_Vec(AdC1.Value(first1),AdC.Value(first2)));
if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) { if (dir.IsNormal(gp_Dir(vec),Precision::Angular())) {
// plan // plane
IType = 4; IType = 4;
} }
else { else {
@ -286,12 +259,12 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
} }
} }
else { else {
// longueur differente --> pas de cas particulier // different length --> no particular case
IType = 0; IType = 0;
} }
} }
else { else {
// droite non parallele --> pas de cas particulier // not parallel straight line --> no particular case
IType = 0; IType = 0;
} }
} }
@ -301,11 +274,11 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
IType = 4; //plane IType = 4; //plane
else if (AdC.GetType() == GeomAbs_Circle) else if (AdC.GetType() == GeomAbs_Circle)
{ {
// seul cas particulier avec une edge degeneree au debut : le cone // the only particular case with degenerated edge at the beginning the cone
pos = AdC.Circle().Location(); pos = AdC.Circle().Location();
axe = AdC.Circle().Axis(); axe = AdC.Circle().Axis();
if (pos1.IsEqual(pos,Precision::Confusion())) { if (pos1.IsEqual(pos,Precision::Confusion())) {
// le sommet est confondu avec le centre du cercle // the top is mixed with the center of the circle
IType = 0; IType = 0;
} }
else { else {
@ -313,11 +286,11 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
gp_Dir dir(vec); gp_Dir dir(vec);
axe1 = gp_Ax1(pos1,dir); axe1 = gp_Ax1(pos1,dir);
if (axe.IsParallel(axe1,Precision::Angular())) { if (axe.IsParallel(axe1,Precision::Angular())) {
// le sommet est bien sur l'axe du cercle // the top is on the axis of the circle
IType = -2; IType = -2;
} }
else { else {
// sommet incorrect --> pas de cas particulier // incorrect top --> no particular case
IType = 0; IType = 0;
} }
} }
@ -328,7 +301,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1,
} }
} }
// tore et extrusion ne sont pas des cas part. // torus and extrusion are not particular cases.
if (IType == 3 || IType == 5) IType = 0; if (IType == 3 || IType == 5) IType = 0;
return IType; return IType;
} }
@ -354,7 +327,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
Handle(Geom_Curve) C1; Handle(Geom_Curve) C1;
Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1); Standard_Boolean degen1 = BRep_Tool::Degenerated(Edge1);
if(degen1) { if(degen1) {
// cone avec arete degeneree au sommet // cone with degenerated edge at the top
TopExp::Vertices(Edge1,v1f,v1l); TopExp::Vertices(Edge1,v1f,v1l);
} }
else { else {
@ -377,7 +350,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
Handle(Geom_Curve) C2; Handle(Geom_Curve) C2;
Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2); Standard_Boolean degen2 = BRep_Tool::Degenerated(Edge2);
if(degen2) { if(degen2) {
// cone avec arete degeneree au sommet // cone with degenerated edge at the top
TopExp::Vertices(Edge2,v2f,v2l); TopExp::Vertices(Edge2,v2f,v2l);
} }
else { else {
@ -419,7 +392,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
Handle(Geom_Surface) surface; Handle(Geom_Surface) surface;
Standard_Real V, Rad; Standard_Real V, Rad;
if (IType==1) { if (IType==1) {
// surface cylindrique // cylindrical surface
gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ(); gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ(); gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
gp_Ax3 Ac1 = c1.Position(); gp_Ax3 Ac1 = c1.Position();
@ -434,7 +407,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
( Cyl, aa, bb, Min(0.,V), Max(0.,V) ); ( Cyl, aa, bb, Min(0.,V), Max(0.,V) );
} }
else if (IType==2) { else if (IType==2) {
// surface conique // conical surface
gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ(); gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
gp_Ax3 Ak1 = k1.Position(); gp_Ax3 Ak1 = k1.Position();
if (degen2) { if (degen2) {
@ -460,7 +433,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
( Cone, aa, bb, Min(0.,V), Max(0.,V) ); ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
} }
else if (IType==-2) { else if (IType==-2) {
// surface conique avec le sommet au debut (degen1 est vrai) // conical surface with the top at the beginning (degen1 is true)
gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ(); gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
gp_Ax3 Ak2 = k2.Position(); gp_Ax3 Ak2 = k2.Position();
Ak2.SetLocation(BRep_Tool::Pnt(v1f)); Ak2.SetLocation(BRep_Tool::Pnt(v1f));
@ -479,7 +452,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
( Cone, aa, bb, Min(0.,V), Max(0.,V) ); ( Cone, aa, bb, Min(0.,V), Max(0.,V) );
} }
else if (IType==3) { else if (IType==3) {
// surface torique ? // torus surface ?
} }
else if (IType==4) { else if (IType==4) {
// surface plane // surface plane
@ -508,7 +481,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
//( Plan, aa, bb, Min(0.,V), Max(0.,V) ); //( Plan, aa, bb, Min(0.,V), Max(0.,V) );
} }
else if (IType==5) { else if (IType==5) {
// surface d'extrusion ? // surface of extrusion ?
} }
else { else {
// IType incorrect // IType incorrect
@ -638,12 +611,12 @@ void BRepFill_Generator::Perform()
Standard_Boolean Periodic Standard_Boolean Periodic
= (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2); = (Edge1.Closed() || degen1) && (Edge2.Closed() || degen2);
// ATTENTION : un wire non ponctuel ne doit pas // ATTENTION : a non-punctual wire should not
// contenir une edge ponctuelle // contain a punctual edge
if (!wPoint1) ex1.Next(); if (!wPoint1) ex1.Next();
if (!wPoint2) ex2.Next(); if (!wPoint2) ex2.Next();
// initialisation des vertices // initialization of vertices
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
Standard_Real f1=0, l1=1, f2=0, l2=1; Standard_Real f1=0, l1=1, f2=0, l2=1;
if (Edge1.Orientation() == TopAbs_REVERSED) if (Edge1.Orientation() == TopAbs_REVERSED)
@ -671,10 +644,10 @@ void BRepFill_Generator::Perform()
Periodic Periodic
= (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2); = (E1IsReallyClosed || degen1) && (E2IsReallyClosed || degen2);
} }
// traitement des KPart // processing of KPart
Standard_Integer IType = DetectKPart(Edge1,Edge2); Standard_Integer IType = DetectKPart(Edge1,Edge2);
if (IType==0) { if (IType==0) {
// pas de cas part // no part cases
TopLoc_Location L,L1,L2; TopLoc_Location L,L1,L2;
Handle(Geom_Curve) C1, C2; Handle(Geom_Curve) C1, C2;
@ -735,7 +708,7 @@ void BRepFill_Generator::Perform()
B.MakeFace(Face,Surf,Precision::Confusion()); B.MakeFace(Face,Surf,Precision::Confusion());
} }
else { else {
// cas particulier // particular case
CreateKPart(Edge1,Edge2,IType,Surf); CreateKPart(Edge1,Edge2,IType,Surf);
B.MakeFace(Face,Surf,Precision::Confusion()); B.MakeFace(Face,Surf,Precision::Confusion());
} }
@ -753,13 +726,13 @@ void BRepFill_Generator::Perform()
Handle(Geom_Curve) CC; Handle(Geom_Curve) CC;
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
if (IType==0) { if (IType==0) {
// cas general : Edge3 correspond a l'iso U=f1 // general case : Edge3 corresponds to iso U=f1
CC = Surf->UIso(f1); CC = Surf->UIso(f1);
first=f2; first=f2;
last=l2; last=l2;
} }
else { else {
// cas particulier : il faut calculer la courbe 3d // particular case : it is required to calculate the curve 3d
Extremities(1) = BRep_Tool::Pnt(V1f); Extremities(1) = BRep_Tool::Pnt(V1f);
Extremities(2) = BRep_Tool::Pnt(V2f); Extremities(2) = BRep_Tool::Pnt(V2f);
CC = new Geom_BezierCurve(Extremities); CC = new Geom_BezierCurve(Extremities);
@ -794,13 +767,13 @@ void BRepFill_Generator::Perform()
Handle(Geom_Curve) CC; Handle(Geom_Curve) CC;
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
if (IType==0) { if (IType==0) {
// cas general : Edge4 correspond a l'iso U=l1 // general case : Edge4 corresponds to iso U=l1
CC = Surf->UIso(l1); CC = Surf->UIso(l1);
first=f2; first=f2;
last=l2; last=l2;
} }
else { else {
// cas particulier : il faut calculer la courbe 3d // particular case : it is required to calculate the curve 3d
Extremities(1) = BRep_Tool::Pnt(V1l); Extremities(1) = BRep_Tool::Pnt(V1l);
Extremities(2) = BRep_Tool::Pnt(V2l); Extremities(2) = BRep_Tool::Pnt(V2l);
CC = new Geom_BezierCurve(Extremities); CC = new Geom_BezierCurve(Extremities);

View File

@ -30,7 +30,7 @@
//======================================================================= //=======================================================================
//function : Norm //function : Norm
//purpose : Norme d'une Matrice //purpose : Norm of a Matrix
//======================================================================= //=======================================================================
static Standard_Real Norm(const gp_Mat& M) { static Standard_Real Norm(const gp_Mat& M) {
@ -50,7 +50,7 @@ static Standard_Real Norm(const gp_Mat& M) {
//======================================================================= //=======================================================================
//function : ToG0 //function : ToG0
//purpose : Cacul une tranformation T tq T.M2 = M1 //purpose : Calculate tranformation T such as T.M2 = M1
//======================================================================= //=======================================================================
static void ToG0(const gp_Mat& M1, const gp_Mat& M2, gp_Mat& T) { static void ToG0(const gp_Mat& M1, const gp_Mat& M2, gp_Mat& T) {
@ -133,7 +133,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
//======================================================================= //=======================================================================
//function : TransformInCompatibleLaw //function : TransformInCompatibleLaw
//purpose : Mise en continuite des loi //purpose : Set in continuity of laws
//======================================================================= //=======================================================================
void BRepFill_LocationLaw::TransformInCompatibleLaw(const Standard_Real TolAngular) void BRepFill_LocationLaw::TransformInCompatibleLaw(const Standard_Real TolAngular)
{ {
@ -168,7 +168,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
#if DEB #if DEB
if (N2.Dot(T1) > 1.e-9) { if (N2.Dot(T1) > 1.e-9) {
cout << "Imprecision dans TransformInCompatibleLaw" << endl; cout << "Inprecision in TransformInCompatibleLaw" << endl;
cout << "--- T1.R(N2) = " << N2.Dot(T1) << endl; cout << "--- T1.R(N2) = " << N2.Dot(T1) << endl;
gp_Vec tt; gp_Vec tt;
tt = T1; tt = T1;
@ -186,7 +186,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
//======================================================================= //=======================================================================
//function : TransformInG0Law //function : TransformInG0Law
//purpose : Mise en continuite des loi //purpose : Set in continuity of laws
//======================================================================= //=======================================================================
void BRepFill_LocationLaw::TransformInG0Law() void BRepFill_LocationLaw::TransformInG0Law()
{ {
@ -204,7 +204,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
myLaws->Value(ipath)->SetTrsf(aux); myLaws->Value(ipath)->SetTrsf(aux);
} }
// La loi est elle periodique ? // Is the law periodical ?
if (myPath.Closed()) { if (myPath.Closed()) {
myLaws->Value(myLaws->Length())->D0(Last, M1, V); myLaws->Value(myLaws->Length())->D0(Last, M1, V);
myLaws->Value(1)->GetDomain(First, Last); myLaws->Value(1)->GetDomain(First, Last);
@ -214,7 +214,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
//======================================================================= //=======================================================================
//function : DeleteTransform //function : DeleteTransform
//purpose : Supprime la Mise en continuite des loi //purpose : Remove the setting in continuity of law.
//======================================================================= //=======================================================================
void BRepFill_LocationLaw::DeleteTransform() void BRepFill_LocationLaw::DeleteTransform()
{ {
@ -228,7 +228,7 @@ void BRepFill_LocationLaw::BiNormalIsMain()
//======================================================================= //=======================================================================
//function : NbHoles //function : NbHoles
//purpose : Rechecherche des "Trous" //purpose : Find "Holes"
//======================================================================= //=======================================================================
Standard_Integer BRepFill_LocationLaw::NbHoles(const Standard_Real Tol) Standard_Integer BRepFill_LocationLaw::NbHoles(const Standard_Real Tol)
{ {
@ -324,11 +324,11 @@ const TopoDS_Edge& BRepFill_LocationLaw::Edge(const Standard_Integer Index) cons
return V; return V;
} }
//======================================================================= //===================================================================
//function : PerformVertex //function : PerformVertex
//purpose : Calcul un vertex du balayage a partir d'un vertex d'une section //purpose : Calculate a vertex of sweeping from a vertex of section
// et de l'indice de l'edge dans la trajectoire // and the index of the edge in the trajectory
//======================================================================= //===================================================================
void BRepFill_LocationLaw::PerformVertex(const Standard_Integer Index, void BRepFill_LocationLaw::PerformVertex(const Standard_Integer Index,
const TopoDS_Vertex& Input, const TopoDS_Vertex& Input,
const Standard_Real TolMin, const Standard_Real TolMin,
@ -418,7 +418,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
{ {
First = myLength->Value(Index); First = myLength->Value(Index);
Last = myLength->Value(Index+1); Last = myLength->Value(Index+1);
if (Last<0) { //Il faut effectuer le calcul if (Last<0) { //It is required to carry out the calculation
Standard_Integer ii, NbE = myEdges->Length(); Standard_Integer ii, NbE = myEdges->Length();
Standard_Real Length, f, l; Standard_Real Length, f, l;
GCPnts_AbscissaPoint AbsC; GCPnts_AbscissaPoint AbsC;
@ -441,7 +441,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
//======================================================================= //=======================================================================
//function : IsG1 //function : IsG1
//purpose : Evalue la continuite de la loi en un vertex //purpose : Evaluate the continuity of the law by a vertex
//======================================================================= //=======================================================================
Standard_Integer Standard_Integer
BRepFill_LocationLaw::IsG1(const Standard_Integer Index, BRepFill_LocationLaw::IsG1(const Standard_Integer Index,
@ -506,23 +506,23 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
if (Norm(M1-M2) > SpatialTolerance) isG0 = Standard_False; if (Norm(M1-M2) > SpatialTolerance) isG0 = Standard_False;
if (!isG0) return -1; if (!isG0) return -1;
if (!Ok_D1) return 0; // Pas de controle de la derive if (!Ok_D1) return 0; // No control of the derivative
if ( (DV1.Magnitude()>EpsNul) && (DV2.Magnitude()>EpsNul) if ( (DV1.Magnitude()>EpsNul) && (DV2.Magnitude()>EpsNul)
&& (DV1.Angle(DV2) > AngularTolerance) ) isG1 = Standard_False; && (DV1.Angle(DV2) > AngularTolerance) ) isG1 = Standard_False;
// Pour la suite, les test sont plutot empirique // For the next, the tests are mostly empirical
Standard_Real Norm1 = Norm(DM1); Standard_Real Norm1 = Norm(DM1);
Standard_Real Norm2 = Norm(DM2); Standard_Real Norm2 = Norm(DM2);
// Si les 2 normes sont nulle c'est bon // It two 2 norms are null, it is good
if ((Norm1 > EpsNul) || (Norm2 > EpsNul)) { if ((Norm1 > EpsNul) || (Norm2 > EpsNul)) {
// sinon on compare les matrice normalise // otherwise the normalized matrices are compared
if ((Norm1 > EpsNul) && (Norm2 > EpsNul)) { if ((Norm1 > EpsNul) && (Norm2 > EpsNul)) {
DM1 /= Norm1; DM1 /= Norm1;
DM2 /= Norm2; DM2 /= Norm2;
if (Norm(DM1 - DM2) > AngularTolerance) isG1 = Standard_False; if (Norm(DM1 - DM2) > AngularTolerance) isG1 = Standard_False;
} }
else isG1 = Standard_False; // 1 Null l'autre pas else isG1 = Standard_False; // 1 Null the other is not
} }
if (isG1) return 1; if (isG1) return 1;
@ -541,13 +541,13 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
Standard_Integer iedge, NbE=myEdges->Length(); Standard_Integer iedge, NbE=myEdges->Length();
Standard_Boolean Trouve = Standard_False; Standard_Boolean Trouve = Standard_False;
//Controle que les longueurs sont calcules //Control that the lengths are calculated
if (myLength->Value(NbE+1) < 0) { if (myLength->Value(NbE+1) < 0) {
Standard_Real f, l; Standard_Real f, l;
CurvilinearBounds(NbE, f, l); CurvilinearBounds(NbE, f, l);
} }
// Recherche de l'interval // Find the interval
for (iedge=1; iedge<=NbE && !Trouve; ) { for (iedge=1; iedge<=NbE && !Trouve; ) {
if (myLength->Value(iedge+1) >= Abcissa) { if (myLength->Value(iedge+1) >= Abcissa) {
Trouve = Standard_True; Trouve = Standard_True;
@ -581,10 +581,10 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
} }
//======================================================================= //===================================================================
//function : D0 //function : D0
//purpose : Positionement d'une section, a une abscisse curviligne donnee //purpose : Position of a section, with a given curviline abscissa
//======================================================================= //===================================================================
void BRepFill_LocationLaw::D0(const Standard_Real Abcissa, void BRepFill_LocationLaw::D0(const Standard_Real Abcissa,
TopoDS_Shape& W) TopoDS_Shape& W)
{ {
@ -608,7 +608,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
else { else {
W.Nullify(); W.Nullify();
#if DEB #if DEB
cout << "BRepFill_LocationLaw::D0 : Attention positionement hors borne" cout << "BRepFill_LocationLaw::D0 : Attention position out of limits"
<< endl; << endl;
#endif #endif
} }
@ -616,7 +616,7 @@ void BRepFill_LocationLaw::CurvilinearBounds(const Standard_Integer Index,
//======================================================================= //=======================================================================
//function : Abscissa //function : Abscissa
//purpose : Calcul l'abscisse d'un point //purpose : Calculate the abscissa of a point
//======================================================================= //=======================================================================
Standard_Real BRepFill_LocationLaw::Abscissa(const Standard_Integer Index, Standard_Real BRepFill_LocationLaw::Abscissa(const Standard_Integer Index,
const Standard_Real Param) const Standard_Real Param)

View File

@ -143,7 +143,7 @@ myKPart(0)
} }
// recuperons les isos dans leur domaine de restriction. // return isos in their domain of restriction.
Handle(Geom_Curve) UU1, UU2, VV1, VV2; Handle(Geom_Curve) UU1, UU2, VV1, VV2;
Handle(Geom_Surface) S; Handle(Geom_Surface) S;
S = BRep_Tool::Surface(myFace1,L); S = BRep_Tool::Surface(myFace1,L);
@ -197,7 +197,7 @@ myKPart(0)
Vmax = dummyUmax; Vmax = dummyUmax;
} }
// essai dub // try duplication
GeomAdaptor_Surface GAS1(S); GeomAdaptor_Surface GAS1(S);
GeomAbs_SurfaceType Type1 = GAS1.GetType(); GeomAbs_SurfaceType Type1 = GAS1.GetType();
@ -223,7 +223,7 @@ myKPart(0)
Precision::PConfusion(), Precision::PConfusion(),
Vmin, Vmax); Vmin, Vmax);
} }
// fin essai dub // end try duplication
myU1 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU1, BasisPlane), myU1 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU1, BasisPlane),
Umin, Umax); Umin, Umax);
@ -260,7 +260,7 @@ myKPart(0)
} }
} }
// recuperons les isos dans leur domaine de restriction. // return isos in their domain of restriction.
S = BRep_Tool::Surface(myFace2,L); S = BRep_Tool::Surface(myFace2,L);
if (!L.IsIdentity()) if (!L.IsIdentity())
@ -313,7 +313,7 @@ myKPart(0)
Vmax = dummyUmax; Vmax = dummyUmax;
} }
// essai dub // try duplication
GeomAdaptor_Surface GAS2(S); GeomAdaptor_Surface GAS2(S);
GeomAbs_SurfaceType Type2 = GAS2.GetType(); GeomAbs_SurfaceType Type2 = GAS2.GetType();
@ -339,7 +339,7 @@ myKPart(0)
Precision::PConfusion(), Precision::PConfusion(),
Vmin, Vmax); Vmin, Vmax);
} }
// fin essai dub // end try duplication
myU2 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU2, BasisPlane), myU2 = Geom2dAdaptor_Curve(GeomProjLib::Curve2d(UU2, BasisPlane),
Umin, Umax); Umin, Umax);
@ -350,12 +350,12 @@ myKPart(0)
Vmin, Vmax); Vmin, Vmax);
// eval if in a particular case. // eval if in a particular case.
// Cas Particulier si : // Particular case if :
// 1) - Bissec droite // 1) - Straight Bissectrice
// - Bissec orthogonale a l`element de la base. // - Bissectrice orthogonal to the base element.
// ==> Iso sur les 2 faces. // ==> Iso on 2 faces.
// 2) - Bissec droite // 2) - Straight Bissectrice
// - les 2 surfaces sont des plans. // - 2 surfaces are planes.
myCont = GeomAbs_C0; myCont = GeomAbs_C0;
if ( myBis.GetType() == GeomAbs_Line) { if ( myBis.GetType() == GeomAbs_Line) {
@ -408,8 +408,8 @@ void BRepFill_MultiLine::Curves(Handle(Geom_Curve)& Curve,
P1 = ValueOnF1(myBis.FirstParameter()); P1 = ValueOnF1(myBis.FirstParameter());
P2 = ValueOnF1(myBis.LastParameter()); P2 = ValueOnF1(myBis.LastParameter());
// on recherche la valeur de l iso avec le point milieu // find value of the with medium point
// les bouts pouvant etre des points degeneres. // the ends can be degenerated points.
PMil = ValueOnF1(0.5*(myBis.FirstParameter() + myBis.LastParameter())); PMil = ValueOnF1(0.5*(myBis.FirstParameter() + myBis.LastParameter()));
@ -600,7 +600,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
UU = Ext.LowerDistanceParameter(); UU = Ext.LowerDistanceParameter();
Dist = Ext.LowerDistance(); Dist = Ext.LowerDistance();
} }
// Controle avec les `bouts` // Control with `ends`
D1 = P.Distance(TheU.Value(TheU.FirstParameter())); D1 = P.Distance(TheU.Value(TheU.FirstParameter()));
D2 = P.Distance(TheU.Value(TheU.LastParameter())); D2 = P.Distance(TheU.Value(TheU.LastParameter()));
@ -646,7 +646,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
VV = TheV.LastParameter(); VV = TheV.LastParameter();
} }
else { else {
// test si la courbe est du cote `Y negatif`. // test if the curve is at the side `negative Y`.
if ( Min( PF.Y(),PL.Y()) < -Tol) Dist = -Dist; if ( Min( PF.Y(),PL.Y()) < -Tol) Dist = -Dist;
Handle(Geom2d_Line) Line Handle(Geom2d_Line) Line

View File

@ -109,7 +109,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
for (j=jdeb; j<=jfin; j++) { for (j=jdeb; j<=jfin; j++) {
// cas des sections bouclantes // case of looping sections
if (j==jfin && vClosed) { if (j==jfin && vClosed) {
section.AddCurve(BS1); section.AddCurve(BS1);
} }
@ -118,7 +118,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
// read the first edge to initialise CompBS; // read the first edge to initialise CompBS;
edge = TopoDS::Edge(shapes.Value(1,j)); edge = TopoDS::Edge(shapes.Value(1,j));
if (BRep_Tool::Degenerated(edge)) { if (BRep_Tool::Degenerated(edge)) {
// edge degeneree : construction d'une courbe ponctuelle // degenerated edge : construction of a point curve
TopExp::Vertices(edge,vl,vf); TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf); Extremities(1) = BRep_Tool::Pnt(vf);
@ -129,7 +129,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
curv->LastParameter()); curv->LastParameter());
} }
else { else {
// recuperation de la courbe sur l'edge // return the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last); Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last); curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation()); curvTrim->Transform(loc.Transformation());
@ -138,7 +138,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
curvTrim->Reverse(); curvTrim->Reverse();
} }
// transformation en BSpline reparametree sur [i-1,i] // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim); curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) { if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve(); Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
@ -156,14 +156,14 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
BSplCLib::Reparametrize(0.,1.,BSK); BSplCLib::Reparametrize(0.,1.,BSK);
curvBS->SetKnots(BSK); curvBS->SetKnots(BSK);
// initialisation // initialization
GeomConvert_CompCurveToBSplineCurve CompBS(curvBS); GeomConvert_CompCurveToBSplineCurve CompBS(curvBS);
for (i=2; i<=NbEdges; i++) { for (i=2; i<=NbEdges; i++) {
// read the edge // read the edge
edge = TopoDS::Edge(shapes.Value(i,j)); edge = TopoDS::Edge(shapes.Value(i,j));
if (BRep_Tool::Degenerated(edge)) { if (BRep_Tool::Degenerated(edge)) {
// edge degeneree : construction d'une courbe ponctuelle // degenerated edge : construction of a point curve
TopExp::Vertices(edge,vl,vf); TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf); Extremities(1) = BRep_Tool::Pnt(vf);
@ -174,7 +174,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
curv->LastParameter()); curv->LastParameter());
} }
else { else {
// recuperation de la courbe sur l'edge // return the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last); Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last); curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation()); curvTrim->Transform(loc.Transformation());
@ -183,7 +183,7 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
curvTrim->Reverse(); curvTrim->Reverse();
} }
// transformation en BSpline reparametree sur [i-1,i] // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim); curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) { if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve(); Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
@ -213,11 +213,11 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape
Standard_True, Standard_False, 1); Standard_True, Standard_False, 1);
} }
// recuperation de la section finale // return the final section
BS = CompBS.BSplineCurve(); BS = CompBS.BSplineCurve();
section.AddCurve(BS); section.AddCurve(BS);
// cas des sections bouclantes // case of looping sections
if (j==jdeb && vClosed) { if (j==jdeb && vClosed) {
BS1 = BS; BS1 = BS;
} }
@ -399,7 +399,7 @@ BRepFill_NSections::BRepFill_NSections(const TopTools_SequenceOfShape& S,
//======================================================================= //=======================================================================
//function : Init //function : Init
//purpose : On cree une table de GeomFill_SectionLaw //purpose : Create a table of GeomFill_SectionLaw
//======================================================================= //=======================================================================
void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P, void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
const Standard_Boolean Build) const Standard_Boolean Build)
@ -415,7 +415,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
Standard_Real First, Last; Standard_Real First, Last;
TopoDS_Wire W; TopoDS_Wire W;
// On regarde si les wires debut et fin sont ponctuels // Check if the start and end wires are punctual
W = TopoDS::Wire(myShapes(1)); W = TopoDS::Wire(myShapes(1));
for (wexp.Init(W); wexp.More(); wexp.Next()) for (wexp.Init(W); wexp.More(); wexp.Next())
// w1Point = w1Point && B.Degenerated(wexp.Current()); // w1Point = w1Point && B.Degenerated(wexp.Current());
@ -427,10 +427,10 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
w2Point = w2Point && BRep_Tool::Degenerated(wexp.Current()); w2Point = w2Point && BRep_Tool::Degenerated(wexp.Current());
if (w2Point) ifin--; if (w2Point) ifin--;
// On regarde si les wires debut et fin sont identiques // Check if the start and end wires are identical
vclosed = myShapes(1).IsSame(myShapes(NbSects)); vclosed = myShapes(1).IsSame(myShapes(NbSects));
// On compte le nombre d'aretes non degenerees // Count the number of non-degenerated edges
W = TopoDS::Wire(myShapes(ideb)); W = TopoDS::Wire(myShapes(ideb));
for (NbEdge=0, wexp.Init(W); wexp.More(); wexp.Next()) for (NbEdge=0, wexp.Init(W); wexp.More(); wexp.Next())
// if (! B.Degenerated(wexp.Current())) NbEdge++; // if (! B.Degenerated(wexp.Current())) NbEdge++;
@ -438,7 +438,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
myEdges = new (TopTools_HArray2OfShape) (1, NbEdge, 1, NbSects); myEdges = new (TopTools_HArray2OfShape) (1, NbEdge, 1, NbSects);
// On Remplit les tables // Fill tables
uclosed = Standard_True; uclosed = Standard_True;
for (jj=ideb;jj<=ifin;jj++){ for (jj=ideb;jj<=ifin;jj++){
@ -453,11 +453,11 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
} }
} }
// La loi est elle fermee en U ? // Is the law closed by U ?
wClosed = W.Closed(); wClosed = W.Closed();
if (!wClosed) { if (!wClosed) {
// le flag n'etant pas tres sur, on fait une verif // if unsure about the flag, make check
TopoDS_Edge Edge1, Edge2; TopoDS_Edge Edge1, Edge2;
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
Edge1 = TopoDS::Edge (myEdges->Value(NbEdge,jj)); Edge1 = TopoDS::Edge (myEdges->Value(NbEdge,jj));
@ -492,7 +492,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
if (!wClosed) uclosed = Standard_False; if (!wClosed) uclosed = Standard_False;
} }
// sections en bout ponctuelles // point sections at end
if (w1Point) { if (w1Point) {
W = TopoDS::Wire(myShapes(1)); W = TopoDS::Wire(myShapes(1));
wexp.Init(W); wexp.Init(W);
@ -518,9 +518,9 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
mySurface = totalsurf(myEdges->Array2(),myShapes.Length(),NbEdge, mySurface = totalsurf(myEdges->Array2(),myShapes.Length(),NbEdge,
myParams,w1Point,w2Point,uclosed,vclosed,tol); myParams,w1Point,w2Point,uclosed,vclosed,tol);
// On augmente le degre pour que le positionnement D2 // Increase the degree so that the position D2
// sur les GeomFill_NSections soit correct // on GeomFill_NSections could be correct
// cf commentaires dans GeomFill_NSections // see comments in GeomFill_NSections
if (mySurface->VDegree()<2) { if (mySurface->VDegree()<2) {
mySurface->IncreaseDegree(mySurface->UDegree(),2); mySurface->IncreaseDegree(mySurface->UDegree(),2);
} }
@ -532,7 +532,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
} }
#endif #endif
// On Remplit les tables // Fill tables
if (Build) { if (Build) {
for (ii=1; ii<=NbEdge ; ii++) { for (ii=1; ii<=NbEdge ; ii++) {
TColGeom_SequenceOfCurve NC; TColGeom_SequenceOfCurve NC;
@ -563,18 +563,18 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
if (E.Orientation() == TopAbs_REVERSED) { if (E.Orientation() == TopAbs_REVERSED) {
Standard_Real aux; Standard_Real aux;
Handle(Geom_Curve) CBis; Handle(Geom_Curve) CBis;
CBis = C->Reversed(); // Pour eviter de deteriorer la topologie CBis = C->Reversed(); // To avoid the spoiling of the topology
aux = C->ReversedParameter(First); aux = C->ReversedParameter(First);
First = C->ReversedParameter(Last); First = C->ReversedParameter(Last);
Last = aux; Last = aux;
C = CBis; C = CBis;
} }
if ((ii>1) || (!E.Closed()) ) { // On trimme C if ((ii>1) || (!E.Closed()) ) { // Cut C
Handle(Geom_TrimmedCurve) TC = Handle(Geom_TrimmedCurve) TC =
new (Geom_TrimmedCurve) (C,First, Last); new (Geom_TrimmedCurve) (C,First, Last);
C = TC; C = TC;
} }
// sinon On garde l'integrite de la courbe // otherwise preserve the integrity of the curve
} }
NC.Append(C); NC.Append(C);
} }
@ -646,7 +646,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
///======================================================================= ///=======================================================================
//function : VertexTol //function : VertexTol
//purpose : Evalue le trou entre 2 edges de la section //purpose : Evaluate the hole between 2 edges of the section
//======================================================================= //=======================================================================
Standard_Real BRepFill_NSections::VertexTol(const Standard_Integer Index, Standard_Real BRepFill_NSections::VertexTol(const Standard_Integer Index,
const Standard_Real Param) const const Standard_Real Param) const
@ -654,7 +654,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
Standard_Real Tol = Precision::Confusion(); Standard_Real Tol = Precision::Confusion();
Standard_Integer I1, I2; Standard_Integer I1, I2;
if ( (Index==0) || (Index==myEdges->ColLength()) ) { if ( (Index==0) || (Index==myEdges->ColLength()) ) {
if (!uclosed) return Tol; //Le moins faux possible if (!uclosed) return Tol; //The least possible error
I1 = myEdges->ColLength(); I1 = myEdges->ColLength();
I2 = 1; I2 = 1;
} }
@ -753,7 +753,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
TopoDS_Edge Edge1, Edge2; TopoDS_Edge Edge1, Edge2;
if ( (Index==0) || (Index==myEdges->ColLength()) ) { if ( (Index==0) || (Index==myEdges->ColLength()) ) {
if (!uclosed) return GeomAbs_C0; //Le moins faux possible if (!uclosed) return GeomAbs_C0; //The least possible error
Edge1 = TopoDS::Edge (myEdges->Value(myEdges->ColLength(),jj)); Edge1 = TopoDS::Edge (myEdges->Value(myEdges->ColLength(),jj));
Edge2 = TopoDS::Edge (myEdges->Value(1,jj)); Edge2 = TopoDS::Edge (myEdges->Value(1,jj));

View File

@ -224,7 +224,7 @@ static Standard_Boolean KPartCircle
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap, BRepFill_IndexedDataMapOfOrientedShapeListOfShape& myMap,
Standard_Boolean& myIsDone) Standard_Boolean& myIsDone)
{ {
// Un seul contour qui est un cercle ferme // The only contour which is a closed circle
TopExp_Explorer exp(mySpine,TopAbs_EDGE); TopExp_Explorer exp(mySpine,TopAbs_EDGE);
Standard_Integer NbEdges = 0; Standard_Integer NbEdges = 0;
TopoDS_Edge E; TopoDS_Edge E;
@ -319,7 +319,7 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face& Spine,
myMap.Clear(); myMap.Clear();
myMapSpine.Clear(); myMapSpine.Clear();
//------------------------------------------------------------------ //------------------------------------------------------------------
// decoupe du spine pour les lieux bissecteurs. // cut the spine for bissectors.
//------------------------------------------------------------------ //------------------------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
static BRepMAT2d_Explorer Exp; static BRepMAT2d_Explorer Exp;
@ -339,8 +339,8 @@ void BRepFill_OffsetWire::Init(const TopoDS_Face& Spine,
//----------------------------------------------------- //-----------------------------------------------------
// Calcul de la carte des lieux bissecteurs a gauche. // Calculate the map of bissectors to the left.
// et des Liens Topologie -> elements de base de la carte. // and Links Topology -> base elements of the map.
//----------------------------------------------------- //-----------------------------------------------------
// Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin // Modified by Sergey KHROMOV - Tue Nov 26 17:39:03 2002 Begin
@ -395,7 +395,7 @@ const TopTools_ListOfShape& BRepFill_OffsetWire::GeneratedShapes
{ {
if (!myCallGen) { if (!myCallGen) {
if (!myMapSpine.IsEmpty()) { if (!myMapSpine.IsEmpty()) {
// myMapSpine peut etre vide si on est passe par PerformWithBilo. // myMapSpine can be empty if passed by PerformWithBilo.
TopTools_DataMapIteratorOfDataMapOfShapeShape it(myMapSpine); TopTools_DataMapIteratorOfDataMapOfShapeShape it(myMapSpine);
for (; it.More(); it.Next()) { for (; it.More(); it.Next()) {
if (myMap.Contains(it.Key())) { if (myMap.Contains(it.Key())) {
@ -632,7 +632,7 @@ void Compute (const TopoDS_Face& Spine,
TopoDS_Wire NewW = TopoDS::Wire(aLocalShape); TopoDS_Wire NewW = TopoDS::Wire(aLocalShape);
// TopoDS_Wire NewW = TopoDS::Wire(CurW.Moved(L)); // TopoDS_Wire NewW = TopoDS::Wire(CurW.Moved(L));
B.Add(aShape,NewW); B.Add(aShape,NewW);
// mise a jour de la Map. // update Map.
TopoDS_Iterator it1( CurW); TopoDS_Iterator it1( CurW);
TopoDS_Iterator it2( NewW); TopoDS_Iterator it2( NewW);
for ( ; it1.More(); it1.Next(), it2.Next()) { for ( ; it1.More(); it1.Next(), it2.Next()) {
@ -675,32 +675,28 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
myMap.Clear(); myMap.Clear();
//*****************************************
// si myOffset = 0, on ne s'emmerde pas !!
//*****************************************
if ( Abs(myOffset) < Precision::Confusion()) { if ( Abs(myOffset) < Precision::Confusion()) {
Compute(mySpine,myShape,myMap,Alt); Compute(mySpine,myShape,myMap,Alt);
myIsDone = Standard_True; myIsDone = Standard_True;
return; return;
} }
//****************************** //********************************
// Calcul pour un offset non nul // Calculate for a non null offset
//****************************** //********************************
if (KPartCircle(mySpine,Offset,Alt,myShape,myMap,myIsDone)) return; if (KPartCircle(mySpine,Offset,Alt,myShape,myMap,myIsDone)) return;
BRep_Builder myBuilder; BRep_Builder myBuilder;
myBuilder.MakeCompound(TopoDS::Compound(myShape)); myBuilder.MakeCompound(TopoDS::Compound(myShape));
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// MapNodeVertex : associe a chaque noeud de la carte (key1) et // MapNodeVertex : associate to each node of the map (key1) and to
// a chaque element du profil (key2) un vertex (item). // each element of the profile (key2) a vertex (item).
// MapBis : ensemble des edges ou vertex (item) generes par // MapBis : all edges or vertices (item) generated by
// une bisectrice sur une face ou un edge (key)des // a bisectrice on a face or an edge (key) of revolution tubes.
// tuyaux ou revol. // MapVerPar : Map of parameters of vertices on parallel edges
// MapVerPar : Map des parametres des vertex sur les edges paralleles // the list contained in MapVerPar (E) corresponds to
// la liste contenue dans MapVerPar (E) correspond aux // parameters on E of vertices contained in MapBis(E);
// parametres sur E des vertex contenu dans MapBis(E);
//--------------------------------------------------------------------- //---------------------------------------------------------------------
@ -721,7 +717,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
(RefPlane->Translated( ALT * gp_Vec(RefPlane->Axis().Direction() ))); (RefPlane->Translated( ALT * gp_Vec(RefPlane->Axis().Direction() )));
//--------------------------------------------------------------- //---------------------------------------------------------------
// Construction des Cercles et des OffsetCurves // Construction of Circles and OffsetCurves
//--------------------------------------------------------------- //---------------------------------------------------------------
for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) { for (Standard_Integer ic = 1; ic <= Locus.NumberOfContours(); ic++) {
@ -743,13 +739,13 @@ void BRepFill_OffsetWire::PerformWithBiLo
#ifdef DEB #ifdef DEB
if (AffichEdge) { if (AffichEdge) {
cout << " Fin Construction des primitives geometriques"<<endl; cout << " End Construction of geometric primitives "<<endl;
} }
#endif #endif
//--------------------------------------------------- //---------------------------------------------------
// Constructions des vertex de l offset. // Construction of offset vertices.
//--------------------------------------------------- //---------------------------------------------------
BRepFill_DataMapOfOrientedShapeListOfShape Detromp; BRepFill_DataMapOfOrientedShapeListOfShape Detromp;
Handle(MAT_Arc) CurrentArc; Handle(MAT_Arc) CurrentArc;
@ -774,9 +770,9 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
#endif #endif
//----------------------------------------------------------------------- //-------------------------------------------------------------------
// Recuperation des elements du spine correspondant aux basicElts separes. // Return elements of the spine corresponding to separate basicElts.
//----------------------------------------------------------------------- //-------------------------------------------------------------------
S [0] = Link.GeneratingShape(CurrentArc->FirstElement()); S [0] = Link.GeneratingShape(CurrentArc->FirstElement());
S [1] = Link.GeneratingShape(CurrentArc->SecondElement()); S [1] = Link.GeneratingShape(CurrentArc->SecondElement());
@ -787,8 +783,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
BRepFill_DataMapOfShapeSequenceOfPnt MapSeqPar; BRepFill_DataMapOfShapeSequenceOfPnt MapSeqPar;
//----------------------------------------------------------- //-----------------------------------------------------------
// Recuperation des edges paralleles sur chaque face. // Return parallel edges on each face.
// Si pas d offset generees => saut a la bissectrice suivante. // If no offset generated => move to the next bissectrice.
//-------------------------------------------------------------- //--------------------------------------------------------------
if (myMap.Contains(S[0]) && myMap.Contains(S[1])) { if (myMap.Contains(S[0]) && myMap.Contains(S[1])) {
E [0] = TopoDS::Edge(myMap.FindFromKey(S[0]).First()); E [0] = TopoDS::Edge(myMap.FindFromKey(S[0]).First());
@ -797,8 +793,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
else continue; else continue;
//----------------------------------------------------------- //-----------------------------------------------------------
// Construction des vertex correspondant au noeud de la carte. // Construction of vertices corresponding to the node of the map.
// si ils sont sur l offset. // if they are on the offset.
//----------------------------------------------------------- //-----------------------------------------------------------
TopoDS_Vertex VS,VE; TopoDS_Vertex VS,VE;
Handle(MAT_Node) Node1, Node2; Handle(MAT_Node) Node1, Node2;
@ -828,7 +824,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
//--------------------------------------------- //---------------------------------------------
// Construction des geometries. // Construction of geometries.
//--------------------------------------------- //---------------------------------------------
BRepFill_TrimEdgeTool Trim (Bisec, BRepFill_TrimEdgeTool Trim (Bisec,
Locus.GeomElt(CurrentArc->FirstElement()), Locus.GeomElt(CurrentArc->FirstElement()),
@ -836,7 +832,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
myOffset); myOffset);
//----------------------------------------------------------- //-----------------------------------------------------------
// Construction des vertex sur les edges paralleles au spine. // Construction of vertices on edges parallel to the spine.
//----------------------------------------------------------- //-----------------------------------------------------------
Trim.IntersectWith(E [0], E [1], Params); Trim.IntersectWith(E [0], E [1], Params);
@ -857,7 +853,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
Vertices.SetValue(1,VS); Vertices.SetValue(1,VS);
else else
// le point n avait pas ete trouve par IntersectWith // the point was not found by IntersectWith
Vertices.Prepend(VS); Vertices.Prepend(VS);
} }
if (EndOnEdge) { if (EndOnEdge) {
@ -867,17 +863,17 @@ void BRepFill_OffsetWire::PerformWithBiLo
Vertices.SetValue(Params.Length(),VE); Vertices.SetValue(Params.Length(),VE);
else else
// le point n avait pas ete trouve par IntersectWith // the point was not found by IntersectWith
Vertices.Append(VE); Vertices.Append(VE);
} }
//------------------------------------------------------------ //------------------------------------------------------------
// Mise a jour Detromp. // Update Detromp.
// Detromp permetra de supprimer les vertex sur l offset // Detromp allows to remove vertices on the offset
// correspondant a des zones de tangences // corresponding to tangency zones
// dans Detromp sont ranges les vertex qui limitent // Detromp ranks the vertices that limit
// les portions de la bissectrices situes entre le spine et // the parts of the bissectrices located between the spine and the
// l offset. // offset.
//------------------------------------------------------------ //------------------------------------------------------------
if (!Detromp.IsBound(S[0])) Detromp.Bind(S[0],EmptyList); if (!Detromp.IsBound(S[0])) Detromp.Bind(S[0],EmptyList);
if (!Detromp.IsBound(S[1])) Detromp.Bind(S[1],EmptyList); if (!Detromp.IsBound(S[1])) Detromp.Bind(S[1],EmptyList);
@ -886,8 +882,8 @@ void BRepFill_OffsetWire::PerformWithBiLo
UpdateDetromp (Detromp(S[0]), Detromp(S[1]), Vertices, Params, UpdateDetromp (Detromp(S[0]), Detromp(S[1]), Vertices, Params,
Bisec, StartOnEdge, EndOnEdge, Trim); Bisec, StartOnEdge, EndOnEdge, Trim);
//---------------------------------------------- //----------------------------------------------
// Stockage des vertex sur les edges paralleles. // Storage of vertices on parallel edges.
// on remplit MapBis et MapVerPar. // fill MapBis and MapVerPar.
//---------------------------------------------- //----------------------------------------------
if (!Vertices.IsEmpty()) { if (!Vertices.IsEmpty()) {
for (k = 0; k <= 1; k++) { for (k = 0; k <= 1; k++) {
@ -904,11 +900,10 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
else { else {
//------------------------------------------------------------ //------------------------------------------------------------
//POUR LES CERCLES COMPLETS . la parallele peut etre contenue // FOR COMPLETE CIRCLES. the parallel line can be contained
// dans la zone sans intersection avec la frontiere // in the zone without intersection with the border
// pas d intersection // no intersection
// si myoffset est < distance des noeuds la parallele peut etre // if myoffset is < distance of nodes the parallel can be valid.
// valide.
//------------------------------------------------------------- //-------------------------------------------------------------
for (k = 0; k <= 1; k++) { for (k = 0; k <= 1; k++) {
if (!MapBis.IsBound(E[k])) { if (!MapBis.IsBound(E[k])) {
@ -923,12 +918,12 @@ void BRepFill_OffsetWire::PerformWithBiLo
#ifdef DEB #ifdef DEB
if (AffichEdge) { if (AffichEdge) {
cout << " Fin Construction des vertex sur les offsets"<<endl; cout << " End Construction of vertices on offsets"<<endl;
} }
#endif #endif
//---------------------------------- //----------------------------------
// Construction des edges paralleles. // Construction of parallel edges.
//---------------------------------- //----------------------------------
TopTools_IndexedDataMapOfShapeShape MapVV; TopTools_IndexedDataMapOfShapeShape MapVV;
@ -955,7 +950,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
else { else {
//----------------- //-----------------
// Cercles complets // Complete circles
//----------------- //-----------------
myMap(j).Append(CurrentEdge); myMap(j).Append(CurrentEdge);
} }
@ -992,11 +987,11 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
//---------------------------------- //----------------------------------
// Constructions des wires offset. // Construction of offset wires.
//---------------------------------- //----------------------------------
MakeWires (); MakeWires ();
// Mise a jour des vertex ( Construits dans le plan Z = 0) !!! // Update vertices ( Constructed in the plane Z = 0) !!!
TopTools_MapOfShape MapVertex; TopTools_MapOfShape MapVertex;
for ( TopExp_Explorer exp(myShape,TopAbs_VERTEX); exp.More(); exp.Next()) { for ( TopExp_Explorer exp(myShape,TopAbs_VERTEX); exp.More(); exp.Next()) {
TopoDS_Vertex V = TopoDS::Vertex(exp.Current()); TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
@ -1007,7 +1002,7 @@ void BRepFill_OffsetWire::PerformWithBiLo
} }
} }
// Constructions des courbes 3d. // Construction of curves 3d.
BRepLib::BuildCurves3d(myShape); BRepLib::BuildCurves3d(myShape);
MapVertex.Clear(); MapVertex.Clear();
TopExp_Explorer Explo( myShape, TopAbs_EDGE ); TopExp_Explorer Explo( myShape, TopAbs_EDGE );
@ -1109,7 +1104,7 @@ void BRepFill_OffsetWire::PrepareSpine()
myMapSpine.Bind(V2,V2); myMapSpine.Bind(V2,V2);
Cuts.Clear(); Cuts.Clear();
// Decoupe // Cut
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
// Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin // Modified by Sergey KHROMOV - Thu Nov 16 17:29:29 2000 Begin
if (nbEdges == 2 && nbResEdges == 0) if (nbEdges == 2 && nbResEdges == 0)
@ -1161,7 +1156,7 @@ void BRepFill_OffsetWire::PrepareSpine()
void BRepFill_OffsetWire::MakeWires() void BRepFill_OffsetWire::MakeWires()
{ {
//-------------------------------------------------------- //--------------------------------------------------------
// creation d une liste unique des edges paralelles crees. // creation of a single list of created parallel edges.
//-------------------------------------------------------- //--------------------------------------------------------
TopTools_SequenceOfShape TheEdges; TopTools_SequenceOfShape TheEdges;
TopTools_ListOfShape TheWires; TopTools_ListOfShape TheWires;
@ -1192,7 +1187,7 @@ void BRepFill_OffsetWire::MakeWires()
} }
//-------------------------------------- //--------------------------------------
// Creation des wires paralleles. // Creation of parallel wires.
//-------------------------------------- //--------------------------------------
BRep_Builder B; BRep_Builder B;
@ -1227,7 +1222,7 @@ void BRepFill_OffsetWire::MakeWires()
while(!End) { while(!End) {
//------------------------------- //-------------------------------
// Construction d un wire. // Construction of a wire.
//------------------------------- //-------------------------------
TopExp::Vertices(CE,V1,V2); TopExp::Vertices(CE,V1,V2);
if (!CV.IsSame(V1)) CV = V1; else CV = V2; if (!CV.IsSame(V1)) CV = V1; else CV = V2;
@ -1250,7 +1245,7 @@ void BRepFill_OffsetWire::MakeWires()
if (!End) { if (!End) {
if (MVE.FindFromKey(CV).Extent() > 2) { if (MVE.FindFromKey(CV).Extent() > 2) {
//cout <<"vertex sur plus de 2 edges dans une face."<<endl; //cout <<"vertex on more that 2 edges in a face."<<endl;
} }
for ( itl.Initialize(MVE.FindFromKey(CV)); itl.More(); itl.Next()) { for ( itl.Initialize(MVE.FindFromKey(CV)); itl.More(); itl.Next()) {
if (itl.Value().IsSame(CE)) { if (itl.Value().IsSame(CE)) {
@ -1281,9 +1276,9 @@ void BRepFill_OffsetWire::MakeWires()
TheWires.Append(NW); TheWires.Append(NW);
} }
// mise a jour de myShape : // update myShape :
// -- si un seul wire : myShape est un Wire // -- if only one wire : myShape is a Wire
// -- si plusieurs wires : myShape est un Compound. // -- if several wires : myShape is a Compound.
if ( TheWires.Extent() == 1) { if ( TheWires.Extent() == 1) {
myShape = TheWires.First(); myShape = TheWires.First();
} }
@ -1572,13 +1567,11 @@ void BRepFill_OffsetWire::FixHoles()
//======================================================================= //=======================================================================
//function : CutEdge //function : CutEdge
//purpose : Decoupe d une edge aux extrema de courbures et aux points //purpose : Cut edge at the extrema of curvatures and points of inflexion.
// d inflexion. // So, closed circles are cut in two.
// Les cercles fermes sont aussi decoupes en deux. // If <Cuts> is empty, the edge is not modified.
// Si <Cuts> est vide l edge n est pas modifie. // The first and the last vertex of the initial edge
// Le premier et le dernier vertex de l edge originale // belong to the first and the last parts respectively.
// appartiennent respectivement a la premiere et derniere
// portions.
//======================================================================= //=======================================================================
Standard_Integer CutEdge (const TopoDS_Edge& E, Standard_Integer CutEdge (const TopoDS_Edge& E,
const TopoDS_Face& F, const TopoDS_Face& F,
@ -1611,7 +1604,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
( Abs(f-l) >= PI) ) { ( Abs(f-l) >= PI) ) {
return 0; return 0;
//--------------------------- //---------------------------
// Decoupe cercle ferme. // Cut closed circle.
//--------------------------- //---------------------------
Standard_Real m = (f + l)*0.5; Standard_Real m = (f + l)*0.5;
// Modified by Sergey KHROMOV - Wed Mar 6 17:37:28 2002 Begin // Modified by Sergey KHROMOV - Wed Mar 6 17:37:28 2002 Begin
@ -1636,13 +1629,13 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
Cuts.Append(FE.Oriented(E.Orientation())); Cuts.Append(FE.Oriented(E.Orientation()));
Cuts.Append(LE.Oriented(E.Orientation())); Cuts.Append(LE.Oriented(E.Orientation()));
//-------- //--------
// Retour. // Return.
//-------- //--------
return 2; return 2;
} }
//------------------------- //-------------------------
// Decoupe de la courbe. // Cut curve.
//------------------------- //-------------------------
Cuter.Perform(CT2d); Cuter.Perform(CT2d);
@ -1650,7 +1643,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
if (ForceCut == 0) { if (ForceCut == 0) {
if (Cuter.UnModified()) { if (Cuter.UnModified()) {
//----------------------------- //-----------------------------
// edge non modifiee => retour. // edge not modified => return.
//----------------------------- //-----------------------------
return 0; return 0;
} else { } else {
@ -1687,7 +1680,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E,
// Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End // Modified by Sergey KHROMOV - Thu Nov 16 17:28:37 2000 End
//-------------------------------------- //--------------------------------------
// Creation des edges decoupees. // Creation of cut edges.
//-------------------------------------- //--------------------------------------
VF = V1; VF = V1;
@ -1779,7 +1772,7 @@ void MakeCircle (const TopoDS_Edge& E,
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map, BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
const Handle(Geom_Plane)& RefPlane) const Handle(Geom_Plane)& RefPlane)
{ {
// eval the Axis of the Circle. // evaluate the Axis of the Circle.
Standard_Real f,l; Standard_Real f,l;
Handle(Geom2d_Curve) GC = BRep_Tool::CurveOnSurface(E,F,f,l); Handle(Geom2d_Curve) GC = BRep_Tool::CurveOnSurface(E,F,f,l);
gp_Vec2d DX; gp_Vec2d DX;
@ -1831,8 +1824,8 @@ void MakeOffset (const TopoDS_Edge& E,
Geom2dAdaptor_Curve AC(G2d,f,l); Geom2dAdaptor_Curve AC(G2d,f,l);
if ( AC.GetType() == GeomAbs_Circle) { if ( AC.GetType() == GeomAbs_Circle) {
// si l offset est superieur ou egal au rayon et du cote de la // if the offset is greater otr equal to the radius and the side of the
// concavite du cercle => edge null. // concavity of the circle => edge null.
gp_Circ2d C1(AC.Circle()); gp_Circ2d C1(AC.Circle());
#ifdef DEB #ifdef DEB
Standard_Real radius = Standard_Real radius =
@ -1845,7 +1838,7 @@ void MakeOffset (const TopoDS_Edge& E,
Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.; Standard_Real Signe = ( Crossed > 0.) ? 1. : -1.;
if (anOffset*Signe < AC.Circle().Radius()) { if (anOffset*Signe < AC.Circle().Radius()) {
// -anOffset vient d une Etrangete adaptoresque!
Handle(Geom2dAdaptor_HCurve) AHC = Handle(Geom2dAdaptor_HCurve) AHC =
new Geom2dAdaptor_HCurve(G2d); new Geom2dAdaptor_HCurve(G2d);
Adaptor3d_OffsetCurve Off(AHC,-anOffset); Adaptor3d_OffsetCurve Off(AHC,-anOffset);
@ -1895,12 +1888,12 @@ void MakeOffset (const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : UpdateDetromp //function : UpdateDetromp
//purpose : Pour chaque interval sur la bissectrice defini par params //purpose : For each interval on bissectrice defined by parameters
// test si le point milieu est a une distance > offset // test if the medium point is at a distance > offset
// dans ce cas les vertex correspondants aux extremites de l interval // in this case vertices corresponding to the extremities of the interval
// sont ranges dans le detrompeur. // are ranked in the proofing.
// => Si un meme vertex apparait deux fois dans le detrompeur la // => If the same vertex appears in the proofing, the
// frontiere de la zone de proximitee est tangente a l offset . // border of the zone of proximity is tangent to the offset .
//======================================================================= //=======================================================================
void UpdateDetromp (TopTools_ListOfShape& Detromp1, void UpdateDetromp (TopTools_ListOfShape& Detromp1,
@ -1921,7 +1914,7 @@ void UpdateDetromp (TopTools_ListOfShape& Detromp1,
U1 = Bis->FirstParameter(); U1 = Bis->FirstParameter();
if (SOnE) { if (SOnE) {
// le premier point de la bissectrice est sur l offset // the first point of the bissectrice is on the offset
V1 = TopoDS::Vertex(Vertices.Value(ii)); V1 = TopoDS::Vertex(Vertices.Value(ii));
ii++; ii++;
} }
@ -1944,7 +1937,7 @@ void UpdateDetromp (TopTools_ListOfShape& Detromp1,
ii ++; ii ++;
} }
// test point milieu entre le dernier params et la fin de la bissectrice. // test medium point between the last parameter and the end of the bissectrice.
U2 = Bis->LastParameter(); U2 = Bis->LastParameter();
if (!EOnE) { if (!EOnE) {
if (!Precision::IsInfinite(U2)) { if (!Precision::IsInfinite(U2)) {
@ -1982,7 +1975,7 @@ Standard_Boolean VertexFromNode (const Handle(MAT_Node)& aNode,
if (!aNode->Infinite() && Abs(aNode->Distance()-Offset) < Tol) { if (!aNode->Infinite() && Abs(aNode->Distance()-Offset) < Tol) {
//------------------------------------------------ //------------------------------------------------
// le Noeud donne un vertex sur l offset // the Node gives a vertex on the offset
//------------------------------------------------ //------------------------------------------------
if (MapNodeVertex.IsBound(aNode)) { if (MapNodeVertex.IsBound(aNode)) {
VN = TopoDS::Vertex(MapNodeVertex(aNode)); VN = TopoDS::Vertex(MapNodeVertex(aNode));
@ -2043,7 +2036,7 @@ void TrimEdge (const TopoDS_Edge& E,
S.Clear(); S.Clear();
//----------------------------------------------------------- //-----------------------------------------------------------
// Tri des deux sequences en fonction du parametre sur l edge. // Parse two sequences depending on the parameter on the edge.
//----------------------------------------------------------- //-----------------------------------------------------------
while (Change) { while (Change) {
Change = Standard_False; Change = Standard_False;
@ -2057,7 +2050,7 @@ void TrimEdge (const TopoDS_Edge& E,
} }
//---------------------------------------------------------- //----------------------------------------------------------
// Si un vertex n est pas dans le detrompeur il est elimine. // If a vertex is not in the proofing, it is eliminated.
//---------------------------------------------------------- //----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) { if (!BRep_Tool::Degenerated(E)) {
for (Standard_Integer k = 1; k <= TheVer.Length(); k ++) { for (Standard_Integer k = 1; k <= TheVer.Length(); k ++) {
@ -2071,9 +2064,9 @@ void TrimEdge (const TopoDS_Edge& E,
} }
//---------------------------------------------------------- //----------------------------------------------------------
// Si un vertex_double apparait deux fois dans le detrompeur // If a vertex_double appears twice in the proofing
// le vertex est elimine . // the vertex is removed.
// sinon on garde une seule de ces representations. // otherwise preserve only one of its representations.
//---------------------------------------------------------- //----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) { if (!BRep_Tool::Degenerated(E)) {
for (Standard_Integer k = 1; k < TheVer.Length(); k ++) { for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
@ -2103,9 +2096,9 @@ void TrimEdge (const TopoDS_Edge& E,
} }
} }
//----------------------------------------------------------- //-----------------------------------------------------------
// Creation des edges. // Creation of edges.
// le nombre de vertex doit etre pair les edges a creer vont // the number of vertices should be even. The created edges
// d un vertex d indice impair i au vertex i+1; // go from a vertex with uneven index i to vertex i+1;
//----------------------------------------------------------- //-----------------------------------------------------------
for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) { for (Standard_Integer k = 1; k < TheVer.Length(); k = k+2) {
TopoDS_Shape aLocalShape = E.EmptyCopied(); TopoDS_Shape aLocalShape = E.EmptyCopied();
@ -2150,7 +2143,7 @@ void TrimEdge (const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : DoubleOrNotInside //function : DoubleOrNotInside
//purpose : return True si V apparait 2 fois dans LV ou n est pas dedans. //purpose : return True if V appears twice in LV or is not inside.
//======================================================================= //=======================================================================
Standard_Boolean DoubleOrNotInside (const TopTools_ListOfShape& LV, Standard_Boolean DoubleOrNotInside (const TopTools_ListOfShape& LV,
@ -2369,7 +2362,7 @@ static void QuasiFleche(const Adaptor3d_Curve& C,
Standard_Real theFleche=0; Standard_Real theFleche=0;
Standard_Boolean flecheok = Standard_False; Standard_Boolean flecheok = Standard_False;
if (Norme > Eps) { if (Norme > Eps) {
// Evaluation de la fleche par interpolation . Voir IntWalk_IWalking_5.gxx // Evaluation of the arrow by interpolation. See IntWalk_IWalking_5.gxx
Standard_Real N1 = Vdeb.SquareMagnitude(); Standard_Real N1 = Vdeb.SquareMagnitude();
Standard_Real N2 = Vdelta.SquareMagnitude(); Standard_Real N2 = Vdelta.SquareMagnitude();
if (N1 > Eps && N2 > Eps) { if (N1 > Eps && N2 > Eps) {

View File

@ -98,9 +98,9 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine,
new (GeomFill_CurveAndTrihedron) (TLaw); new (GeomFill_CurveAndTrihedron) (TLaw);
myLoc = new (BRepFill_Edge3DLaw) (mySpine, Loc); myLoc = new (BRepFill_Edge3DLaw) (mySpine, Loc);
if (myLoc->NbLaw() == 0) { if (myLoc->NbLaw() == 0) {
return; // Cas degenere return; // Degenerated case
} }
myLoc->TransformInG0Law(); // Mise en continuite myLoc->TransformInG0Law(); // Set into continuity
BRepFill_SectionPlacement Place(myLoc, Profile); BRepFill_SectionPlacement Place(myLoc, Profile);
myTrsf = Place.Transformation(); myTrsf = Place.Transformation();
@ -111,7 +111,7 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine,
TheProf = myProfile; TheProf = myProfile;
TheProf.Location(Loc2.Multiplied(Loc1)); TheProf.Location(Loc2.Multiplied(Loc1));
// Construit les Shape First && Last // Construct First && Last Shape
Handle(GeomFill_LocationLaw) law; Handle(GeomFill_LocationLaw) law;
gp_Mat M; gp_Mat M;
@ -134,7 +134,7 @@ void BRepFill_Pipe::Perform(const TopoDS_Wire& Spine,
myLoc->Law(myLoc->NbLaw())->GetDomain(first, last); myLoc->Law(myLoc->NbLaw())->GetDomain(first, last);
myLoc->Law(myLoc->NbLaw())->D0(last,M, V); myLoc->Law(myLoc->NbLaw())->D0(last,M, V);
// try { // Pas joli mais il n'y as pas d'autre moyens de tester SetValues // try { // Not good, but there are no other means to test SetValues
fila.SetValues(M(1,1), M(1,2), M(1,3), V.X(), fila.SetValues(M(1,1), M(1,2), M(1,3), V.X(),
M(2,1), M(2,2), M(2,3), V.Y(), M(2,1), M(2,2), M(2,3), V.Y(),
M(3,1), M(3,2), M(3,3), V.Z(), M(3,1), M(3,2), M(3,3), V.Z(),
@ -330,12 +330,12 @@ TopoDS_Shape BRepFill_Pipe::Section(const TopoDS_Vertex& VSpine) const
//======================================================================= //=======================================================================
//function : PipeLine //function : PipeLine
//purpose : Construit un wire par balayage d'un point //purpose : Construct a wire by sweeping of a point
//======================================================================= //=======================================================================
TopoDS_Wire BRepFill_Pipe::PipeLine(const gp_Pnt& Point) const TopoDS_Wire BRepFill_Pipe::PipeLine(const gp_Pnt& Point) const
{ {
// Postionnement // Postioning
gp_Pnt P; gp_Pnt P;
P = Point; P = Point;
P.Transform(myTrsf); P.Transform(myTrsf);
@ -344,7 +344,7 @@ TopoDS_Wire BRepFill_Pipe::PipeLine(const gp_Pnt& Point) const
Handle(BRepFill_ShapeLaw) Section = Handle(BRepFill_ShapeLaw) Section =
new (BRepFill_ShapeLaw) (MkV.Vertex()); new (BRepFill_ShapeLaw) (MkV.Vertex());
// Balayage // Sweeping
BRepFill_Sweep MkSw(Section, myLoc, Standard_True); BRepFill_Sweep MkSw(Section, myLoc, Standard_True);
MkSw.Build( BRepFill_Modified, GeomFill_Location, GeomAbs_C2, myDegmax, mySegmax ); MkSw.Build( BRepFill_Modified, GeomFill_Location, GeomAbs_C2, myDegmax, mySegmax );
TopoDS_Shape aLocalShape = MkSw.Shape(); TopoDS_Shape aLocalShape = MkSw.Shape();
@ -486,7 +486,7 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
MkSw.Build( BRepFill_Modified, GeomFill_Location, GeomAbs_C2, myDegmax, mySegmax ); MkSw.Build( BRepFill_Modified, GeomFill_Location, GeomAbs_C2, myDegmax, mySegmax );
result = MkSw.Shape(); result = MkSw.Shape();
// Reperage des elements // Labeling of elements
if (mySections.IsNull()) { if (mySections.IsNull()) {
myFaces = MkSw.SubShape(); myFaces = MkSw.SubShape();
mySections = MkSw.Sections(); mySections = MkSw.Sections();
@ -582,11 +582,10 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
return result; return result;
} }
//======================================================================= //============================================================================
//function : FindEdge //function : FindEdge
//purpose : Recherche le numero de bande correspondant a une edge du //purpose : Find the number of edge corresponding to the edge of the profile.
// profil. //============================================================================
//=======================================================================
Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S, Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S,
const TopoDS_Edge& E, const TopoDS_Edge& E,
@ -640,8 +639,7 @@ Standard_Integer BRepFill_Pipe::FindEdge(const TopoDS_Shape& S,
//======================================================================= //=======================================================================
//function : FindVertex //function : FindVertex
//purpose : Recherche le numero de bande correspondant a une edge du //purpose : Find the number of edge corresponding to an edge of the profile.
// profil.
//======================================================================= //=======================================================================
Standard_Integer BRepFill_Pipe::FindVertex(const TopoDS_Shape& S, Standard_Integer BRepFill_Pipe::FindVertex(const TopoDS_Shape& S,

View File

@ -44,7 +44,7 @@
#include <GeomFill_GuideTrihedronPlan.hxx> #include <GeomFill_GuideTrihedronPlan.hxx>
#include <GeomFill_LocationGuide.hxx> #include <GeomFill_LocationGuide.hxx>
//Specif Guide //Specification Guide
#include <GeomAdaptor_HCurve.hxx> #include <GeomAdaptor_HCurve.hxx>
#include <gp_Trsf.hxx> #include <gp_Trsf.hxx>
@ -80,7 +80,7 @@ static Standard_Boolean BuildBoundaries(const BRepFill_Sweep& theS
//======================================================================= //=======================================================================
//function : ComputeSection //function : ComputeSection
//purpose : Construit une section intermediaire //purpose : Construct an intermediary section
//======================================================================= //=======================================================================
static Standard_Boolean ComputeSection(const TopoDS_Wire& W1, static Standard_Boolean ComputeSection(const TopoDS_Wire& W1,
@ -112,7 +112,7 @@ static Standard_Boolean ComputeSection(const TopoDS_Wire& W1,
//======================================================================= //=======================================================================
//function : PerformTransition //function : PerformTransition
//purpose : Modifie une loi de loc en fonction de Transition //purpose : Modify a law of location depending on Transition
//======================================================================= //=======================================================================
static void PerformTransition(const BRepFill_TransitionStyle Mode, static void PerformTransition(const BRepFill_TransitionStyle Mode,
@ -127,7 +127,7 @@ static void PerformTransition(const BRepFill_TransitionStyle Mode,
} }
//======================================================================= //=======================================================================
//function : PerformPlan //function : PerformPlan
//purpose : Construit s'il existe un plan de remplissage //purpose : Construct a plane of filling if exists
//======================================================================= //=======================================================================
static Standard_Boolean PerformPlan(TopoDS_Shape& S) static Standard_Boolean PerformPlan(TopoDS_Shape& S)
@ -202,7 +202,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
myLaw.Nullify(); myLaw.Nullify();
SetTolerance(); SetTolerance();
// Attention aux wire closed non declare ! // Attention to closed non-declared wire !
if (!mySpine.Closed()) { if (!mySpine.Closed()) {
TopoDS_Vertex Vf, Vl; TopoDS_Vertex Vf, Vl;
TopExp::Vertices(mySpine, Vf, Vl); TopExp::Vertices(mySpine, Vf, Vl);
@ -212,7 +212,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Set //function : Set
//purpose : Definie une loi de Frenet (Corrige) //purpose : Define a law of Frenet (Correct)
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Set(const Standard_Boolean IsFrenet) void BRepFill_PipeShell::Set(const Standard_Boolean IsFrenet)
{ {
@ -228,12 +228,12 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
Handle(GeomFill_CurveAndTrihedron) Loc = Handle(GeomFill_CurveAndTrihedron) Loc =
new (GeomFill_CurveAndTrihedron) (TLaw); new (GeomFill_CurveAndTrihedron) (TLaw);
myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc); myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc);
mySection.Nullify(); //Il faut relocaliser les sections. mySection.Nullify(); //It is required to relocalize sections.
} }
//======================================================================= //=======================================================================
//function : Set //function : Set
//purpose : Definie une loi Constante //purpose : Define a law Constant
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Set(const gp_Ax2& Axe) void BRepFill_PipeShell::Set(const gp_Ax2& Axe)
{ {
@ -245,12 +245,12 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
Handle(GeomFill_CurveAndTrihedron) Loc = Handle(GeomFill_CurveAndTrihedron) Loc =
new (GeomFill_CurveAndTrihedron) (TLaw); new (GeomFill_CurveAndTrihedron) (TLaw);
myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc); myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc);
mySection.Nullify(); //Il faut relocaliser les sections. mySection.Nullify(); //It is required to relocalize sections.
} }
//======================================================================= //=======================================================================
//function : Set //function : Set
//purpose : Construit une loi de location de type binormal fixe //purpose : Construct a law of location of binormal fixed type
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Set(const gp_Dir& BiNormal) void BRepFill_PipeShell::Set(const gp_Dir& BiNormal)
{ {
@ -266,40 +266,40 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Set //function : Set
//purpose : Construit une loi de location de type Darboux //purpose : Construct a law of location of Darboux type
//======================================================================= //=======================================================================
Standard_Boolean BRepFill_PipeShell::Set(const TopoDS_Shape& SpineSupport) Standard_Boolean BRepFill_PipeShell::Set(const TopoDS_Shape& SpineSupport)
{ {
Standard_Boolean B; Standard_Boolean B;
// Il faut une loi de location speciale // A special law of location is required
Handle(BRepFill_EdgeOnSurfLaw) loc = Handle(BRepFill_EdgeOnSurfLaw) loc =
new (BRepFill_EdgeOnSurfLaw) (mySpine, SpineSupport); new (BRepFill_EdgeOnSurfLaw) (mySpine, SpineSupport);
B = loc->HasResult(); B = loc->HasResult();
if (B) { if (B) {
myLocation = loc; myLocation = loc;
myTrihedron = GeomFill_IsDarboux; myTrihedron = GeomFill_IsDarboux;
mySection.Nullify(); //Il faut relocaliser les sections. mySection.Nullify(); //It is required to relocalize the sections.
} }
return B; return B;
} }
//======================================================================= //=======================================================================
//function : Set //function : Set
//purpose : Definit une loi a l'aide d'un contour guide //purpose : Defines a lawv with help of a guided contour
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Set(const TopoDS_Wire& AuxiliarySpine, void BRepFill_PipeShell::Set(const TopoDS_Wire& AuxiliarySpine,
const Standard_Boolean CurvilinearEquivalence, const Standard_Boolean CurvilinearEquivalence,
const Standard_Boolean KeepContact) const Standard_Boolean KeepContact)
{ {
// Reorganisation du guide (pb d'orientation et d'origine) // Reorganization of the guide (pb of orientation and origin)
TopoDS_Wire TheGuide; TopoDS_Wire TheGuide;
TheGuide = AuxiliarySpine; TheGuide = AuxiliarySpine;
Standard_Boolean SpClose = mySpine.Closed(), Standard_Boolean SpClose = mySpine.Closed(),
GuideClose = AuxiliarySpine.Closed(); GuideClose = AuxiliarySpine.Closed();
if (!SpClose && !GuideClose) { if (!SpClose && !GuideClose) {
// Cas ouvert reorientation du guide // Case open reorientation of the guide
TopoDS_Wire sp = mySpine; TopoDS_Wire sp = mySpine;
TopTools_SequenceOfShape Seq; TopTools_SequenceOfShape Seq;
Seq.Append(sp); Seq.Append(sp);
@ -311,8 +311,8 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
TheGuide = TopoDS::Wire(CW.Shape().Value(2)); TheGuide = TopoDS::Wire(CW.Shape().Value(2));
} }
else if (GuideClose) { else if (GuideClose) {
// Cas guide ferme : Determination de l'origine // Case guide closed : Determination of the origin
// & reorientation du guide // & reorientation of the guide
gp_Vec Dir; gp_Vec Dir;
gp_Pnt SpOr; gp_Pnt SpOr;
if (!SpClose) { if (!SpClose) {
@ -336,16 +336,16 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
if (Affich) if (Affich)
DBRep::Set("theguide", TheGuide); DBRep::Set("theguide", TheGuide);
#endif #endif
// on transforme le guide en 1 seule courbe (periodic si posssible) // transform the guide in a single curve (periodic if posssible)
Handle(BRepAdaptor_HCompCurve) Guide = Handle(BRepAdaptor_HCompCurve) Guide =
new (BRepAdaptor_HCompCurve) (TheGuide); new (BRepAdaptor_HCompCurve) (TheGuide);
Guide->ChangeCurve().SetPeriodic(Standard_True); Guide->ChangeCurve().SetPeriodic(Standard_True);
if (CurvilinearEquivalence) { // triedre par abscisse curviligne reduite if (CurvilinearEquivalence) { // trihedron by curvilinear reduced abscissa
if (KeepContact) if (KeepContact)
myTrihedron = GeomFill_IsGuideACWithContact; // avec rotation myTrihedron = GeomFill_IsGuideACWithContact; // with rotation
else else
myTrihedron = GeomFill_IsGuideAC; // sans rotation myTrihedron = GeomFill_IsGuideAC; // without rotation
Handle(GeomFill_GuideTrihedronAC) TLaw Handle(GeomFill_GuideTrihedronAC) TLaw
= new (GeomFill_GuideTrihedronAC) (Guide); = new (GeomFill_GuideTrihedronAC) (Guide);
@ -353,11 +353,11 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
new (GeomFill_LocationGuide) (TLaw); new (GeomFill_LocationGuide) (TLaw);
myLocation = new (BRepFill_ACRLaw) (mySpine, Loc); myLocation = new (BRepFill_ACRLaw) (mySpine, Loc);
} }
else {// triedre par plan else {// trihedron by plane
if (KeepContact) if (KeepContact)
myTrihedron = GeomFill_IsGuidePlanWithContact; // avec rotation myTrihedron = GeomFill_IsGuidePlanWithContact; // with rotation
else else
myTrihedron = GeomFill_IsGuidePlan; // sans rotation myTrihedron = GeomFill_IsGuidePlan; // without rotation
Handle(GeomFill_GuideTrihedronPlan) TLaw = Handle(GeomFill_GuideTrihedronPlan) TLaw =
new (GeomFill_GuideTrihedronPlan) (Guide); new (GeomFill_GuideTrihedronPlan) (Guide);
@ -365,12 +365,12 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
new (GeomFill_LocationGuide) (TLaw); new (GeomFill_LocationGuide) (TLaw);
myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc); myLocation = new (BRepFill_Edge3DLaw) (mySpine, Loc);
} }
mySection.Nullify(); //Il faut relocaliser les sections. mySection.Nullify(); //It is required to relocalize the sections.
} }
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : Ajoute une Section //purpose : Add a Section
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Add(const TopoDS_Shape& Profile, void BRepFill_PipeShell::Add(const TopoDS_Shape& Profile,
const Standard_Boolean WithContact, const Standard_Boolean WithContact,
@ -384,14 +384,14 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : Ajoute une Section //purpose : Add a Section
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Add(const TopoDS_Shape& Profile, void BRepFill_PipeShell::Add(const TopoDS_Shape& Profile,
const TopoDS_Vertex& Location, const TopoDS_Vertex& Location,
const Standard_Boolean WithContact, const Standard_Boolean WithContact,
const Standard_Boolean WithCorrection) const Standard_Boolean WithCorrection)
{ {
Delete(Profile); // Pas de duplication Delete(Profile); // No duplication
BRepFill_Section S (Profile, Location, WithContact, WithCorrection); BRepFill_Section S (Profile, Location, WithContact, WithCorrection);
mySeq.Append(S); mySeq.Append(S);
mySection.Nullify(); mySection.Nullify();
@ -400,7 +400,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : SetLaw //function : SetLaw
//purpose : Section + Loi d'homothetie //purpose : Section + law of homothety
//======================================================================= //=======================================================================
void BRepFill_PipeShell::SetLaw(const TopoDS_Shape& Profile, void BRepFill_PipeShell::SetLaw(const TopoDS_Shape& Profile,
const Handle(Law_Function)& L, const Handle(Law_Function)& L,
@ -415,7 +415,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : SetLaw //function : SetLaw
//purpose : Section + Loi d'homothetie //purpose : Section + Law of homothety
//======================================================================= //=======================================================================
void BRepFill_PipeShell::SetLaw(const TopoDS_Shape& Profile, void BRepFill_PipeShell::SetLaw(const TopoDS_Shape& Profile,
const Handle(Law_Function)& L, const Handle(Law_Function)& L,
@ -434,7 +434,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Delete //function : Delete
//purpose : Supprime une section //purpose : Delete a section
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Delete(const TopoDS_Shape& Profile) void BRepFill_PipeShell::Delete(const TopoDS_Shape& Profile)
{ {
@ -500,14 +500,14 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : SetTransition //function : SetTransition
//purpose : Definit le mode de traitement des coins //purpose : Defines the mode of processing of corners
//======================================================================= //=======================================================================
void BRepFill_PipeShell::SetTransition(const BRepFill_TransitionStyle Mode, void BRepFill_PipeShell::SetTransition(const BRepFill_TransitionStyle Mode,
const Standard_Real Angmin, const Standard_Real Angmin,
const Standard_Real Angmax) const Standard_Real Angmax)
{ {
if (myTransition != Mode) if (myTransition != Mode)
mySection.Nullify(); //Il faut relocaliser les sections. mySection.Nullify(); //It is required to relocalize the sections.
myTransition = Mode; myTransition = Mode;
angmin = Angmin; angmin = Angmin;
angmax = Angmax; angmax = Angmax;
@ -515,7 +515,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Simulate //function : Simulate
//purpose : Calcul N Sections //purpose : Calculate N Sections
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Simulate(const Standard_Integer N, void BRepFill_PipeShell::Simulate(const Standard_Integer N,
TopTools_ListOfShape& List) TopTools_ListOfShape& List)
@ -530,14 +530,14 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
Standard_Boolean Finis=Standard_False; Standard_Boolean Finis=Standard_False;
TopoDS_Shape W; TopoDS_Shape W;
// Calcul des parametres de digitalisation // Calculate the parameters of digitalization
mySection->Law(1)->GetDomain(FirstS, Last); mySection->Law(1)->GetDomain(FirstS, Last);
DeltaS = Last - FirstS; DeltaS = Last - FirstS;
myLocation->CurvilinearBounds(NbL,First, Length); myLocation->CurvilinearBounds(NbL,First, Length);
Delta = Length; Delta = Length;
if (N>1) Delta /= (N-1); if (N>1) Delta /= (N-1);
myLocation->CurvilinearBounds(1,First, Last); // Init de Last myLocation->CurvilinearBounds(1,First, Last); // Initiation of Last
for (U=0.0, ii=1; !Finis ; U+=Delta) { for (U=0.0, ii=1; !Finis ; U+=Delta) {
if (U >= Length) { if (U >= Length) {
U = Length; U = Length;
@ -545,7 +545,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
} }
else { else {
if (ii < NbL) myLocation->CurvilinearBounds(NbL,First, Last); if (ii < NbL) myLocation->CurvilinearBounds(NbL,First, Last);
if (U > Last) U = (Last+First)/2; // On ne saute pas une arete if (U > Last) U = (Last+First)/2; // The edge is not skipped
if (U> First) ii++; if (U> First) ii++;
} }
US = FirstS + (U/Length)*DeltaS; US = FirstS + (U/Length)*DeltaS;
@ -558,7 +558,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Build //function : Build
//purpose : Construit le Shell et l'historique //purpose : Construct the Shell and the history
//======================================================================= //=======================================================================
Standard_Boolean BRepFill_PipeShell::Build() Standard_Boolean BRepFill_PipeShell::Build()
{ {
@ -575,7 +575,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
return Standard_False; return Standard_False;
} }
// 2) Calcul de myFirst et myLast // 2) Calculate myFirst and myLast
mySection->Law(1)->GetDomain(FirstS, LastS); mySection->Law(1)->GetDomain(FirstS, LastS);
mySection->D0(FirstS, myFirst); mySection->D0(FirstS, myFirst);
myLocation->D0(0, myFirst); myLocation->D0(0, myFirst);
@ -671,7 +671,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
Standard_Boolean BRepFill_PipeShell::MakeSolid() Standard_Boolean BRepFill_PipeShell::MakeSolid()
{ {
if (myShape.IsNull()) if (myShape.IsNull())
StdFail_NotDone::Raise("PipeShell is not build"); StdFail_NotDone::Raise("PipeShell is not built");
Standard_Boolean B = myShape.Closed(); Standard_Boolean B = myShape.Closed();
BRep_Builder BS; BRep_Builder BS;
@ -681,7 +681,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
B = (myFirst.Closed() && myLast.Closed()); B = (myFirst.Closed() && myLast.Closed());
} }
if (B) { if (B) {
// Il faut boucher les extremites // It is necessary to block the extremities
B = PerformPlan(myFirst); B = PerformPlan(myFirst);
if (B) { if (B) {
B = PerformPlan(myLast); B = PerformPlan(myLast);
@ -721,7 +721,7 @@ BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
//======================================================================= //=======================================================================
//function : Shape //function : Shape
//purpose : Renvoi le resultat //purpose : Return the result
//======================================================================= //=======================================================================
const TopoDS_Shape& BRepFill_PipeShell::Shape() const const TopoDS_Shape& BRepFill_PipeShell::Shape() const
{ {
@ -730,7 +730,7 @@ const TopoDS_Shape& BRepFill_PipeShell::Shape() const
//======================================================================= //=======================================================================
//function : FirstShape //function : FirstShape
//purpose : Renvoi la section du debut //purpose : Return the start section
//======================================================================= //=======================================================================
const TopoDS_Shape& BRepFill_PipeShell::FirstShape() const const TopoDS_Shape& BRepFill_PipeShell::FirstShape() const
{ {
@ -739,7 +739,7 @@ const TopoDS_Shape& BRepFill_PipeShell::FirstShape() const
//======================================================================= //=======================================================================
//function : LastShape //function : LastShape
//purpose : Renvoi la section de fin //purpose : Return the end section
//======================================================================= //=======================================================================
const TopoDS_Shape& BRepFill_PipeShell::LastShape() const const TopoDS_Shape& BRepFill_PipeShell::LastShape() const
{ {
@ -765,16 +765,16 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
//======================================================================= //=======================================================================
//function : Prepare //function : Prepare
//purpose : - Verifie que tout est pret //purpose : - Check that everything is ready
// - Construit la loi de section // - Construct the law of section
// - Construit la loi de location si necessaire // - Construct the law of location if required
// - Calcul First & Last // - Calculate First & Last
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Prepare() void BRepFill_PipeShell::Prepare()
{ {
TopoDS_Wire theSect; TopoDS_Wire theSect;
if (!IsReady()) StdFail_NotDone::Raise("PipeShell"); if (!IsReady()) StdFail_NotDone::Raise("PipeShell");
if (!myLocation.IsNull() && !mySection.IsNull()) return; // C'est deja pret if (!myLocation.IsNull() && !mySection.IsNull()) return; // It is ready
//Check set of section for right configuration of punctual sections //Check set of section for right configuration of punctual sections
Standard_Integer i; Standard_Integer i;
@ -803,7 +803,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
Standard_Failure::Raise("Wrong usage of punctual sections"); Standard_Failure::Raise("Wrong usage of punctual sections");
} }
// Construction de la loi de location // Construction of the law of location
if(myLocation.IsNull()) if(myLocation.IsNull())
{ {
switch(myTrihedron) switch(myTrihedron)
@ -818,17 +818,17 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
break; break;
} }
default : default :
{ // Pas prevu ! { // Not planned!
Standard_ConstructionError::Raise("PipeShell"); Standard_ConstructionError::Raise("PipeShell");
} }
} }
} }
//Transformation de la loi (Gestion Transition) //Transformation of the law (Transition Management)
PerformTransition(myTransition, myLocation, angmin); PerformTransition(myTransition, myLocation, angmin);
// Construction de la loi de section // Construction of the section law
if (mySeq.Length() == 1) { if (mySeq.Length() == 1) {
Standard_Real p1; Standard_Real p1;
gp_Trsf aTrsf; gp_Trsf aTrsf;
@ -867,20 +867,20 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
} }
// sections bouclantes ? // looping sections ?
if (myLocation->IsClosed()) { if (myLocation->IsClosed()) {
if (ideb>0) { if (ideb>0) {
// on place la section initiale en position finale // place the initial section at the final position
Param.Append(V2); Param.Append(V2);
WSeq.Append(WSeq(ideb)); WSeq.Append(WSeq(ideb));
} }
else if (ifin>0) { else if (ifin>0) {
// on place la section finale en position initiale // place the final section at the initial position
Param.Append(V1); Param.Append(V1);
WSeq.Append(WSeq(ifin)); WSeq.Append(WSeq(ifin));
} }
else { else {
// il faut trouver une section moyenne a imposer en V1 et en V2 // it is necessary to find a medium section to impose by V1 and by V2
Standard_Real pmin = Param.Value(1), pmax = Param.Value(1); Standard_Real pmin = Param.Value(1), pmax = Param.Value(1);
TopoDS_Wire Wmin = TopoDS::Wire(WSeq.Value(1)), Wmax; TopoDS_Wire Wmin = TopoDS::Wire(WSeq.Value(1)), Wmax;
for (iseq=2;iseq<=WSeq.Length();iseq++) { for (iseq=2;iseq<=WSeq.Length();iseq++) {
@ -893,12 +893,12 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
Wmax = TopoDS::Wire(WSeq.Value(iseq)); Wmax = TopoDS::Wire(WSeq.Value(iseq));
} }
} }
// section moyenne entre Wmin et Wmax // medium section between Wmin and Wmax
TopoDS_Wire Wres; TopoDS_Wire Wres;
Standard_Real dmin = Abs(pmin-V1); Standard_Real dmin = Abs(pmin-V1);
Standard_Real dmax = Abs(pmax-V2); Standard_Real dmax = Abs(pmax-V2);
if (ComputeSection(Wmin,Wmax,dmin,dmax,Wres)) { if (ComputeSection(Wmin,Wmax,dmin,dmax,Wres)) {
// on impose la section Wres au debut et a la fin // impose section Wres at the beginning and the end
Param.Append(V1); Param.Append(V1);
WSeq.Append(Wres); WSeq.Append(Wres);
Param.Append(V2); Param.Append(V2);
@ -909,7 +909,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
} }
} }
// tri des sections par parametre croissant // parse sections by increasing parameter
Standard_Boolean play_again = Standard_True; Standard_Boolean play_again = Standard_True;
while (play_again) { while (play_again) {
play_again = Standard_False; play_again = Standard_False;
@ -938,7 +938,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
// Calcul des sections de travail // Calculate work sections
TopTools_SequenceOfShape WorkingSections; TopTools_SequenceOfShape WorkingSections;
WorkingSections.Clear(); WorkingSections.Clear();
TopTools_DataMapOfShapeListOfShape WorkingMap; TopTools_DataMapOfShapeListOfShape WorkingMap;
@ -957,7 +957,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
}// else }// else
// on modifie la loi de location si contact // modify the law of location if contact
if ( (myTrihedron == GeomFill_IsGuidePlanWithContact) if ( (myTrihedron == GeomFill_IsGuidePlanWithContact)
|| (myTrihedron == GeomFill_IsGuideACWithContact) ) { || (myTrihedron == GeomFill_IsGuideACWithContact) ) {
Standard_Real fs, f, l, Delta, Length; Standard_Real fs, f, l, Delta, Length;
@ -972,7 +972,7 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
myLocation->CurvilinearBounds(ipath, f, l); myLocation->CurvilinearBounds(ipath, f, l);
Loc = Handle(GeomFill_LocationGuide)::DownCast(myLocation->Law(ipath)); Loc = Handle(GeomFill_LocationGuide)::DownCast(myLocation->Law(ipath));
Loc->Set(Sec, Standard_True, fs + f*Delta, fs + l*Delta, Loc->Set(Sec, Standard_True, fs + f*Delta, fs + l*Delta,
old_angle, angle); // on force la rotation old_angle, angle); // force the rotation
old_angle = angle; old_angle = angle;
} }
} }
@ -982,8 +982,8 @@ void BRepFill_PipeShell::Generated(const TopoDS_Shape& theShape,
//======================================================================= //=======================================================================
//function : Place //function : Place
//purpose : Met en Place une Section dans le repere local //purpose : Implement a Section in the local refernce frame
// et retourne son parametre sur la trajectoire // and return its parameter on the trajectory
//======================================================================= //=======================================================================
void BRepFill_PipeShell::Place(const BRepFill_Section& Sec, void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
TopoDS_Wire& W, TopoDS_Wire& W,
@ -1006,7 +1006,7 @@ void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
//======================================================================= //=======================================================================
//function : ResetLoc //function : ResetLoc
//purpose : Supprime les references aux sections dans les loi de location //purpose : Remove references to the sections in the laws of location
//======================================================================= //=======================================================================
void BRepFill_PipeShell::ResetLoc() void BRepFill_PipeShell::ResetLoc()
{ {
@ -1015,7 +1015,7 @@ void BRepFill_PipeShell::Place(const BRepFill_Section& Sec,
Handle(GeomFill_LocationGuide) Loc; Handle(GeomFill_LocationGuide) Loc;
for (Standard_Integer isec=1; isec<=myLocation->NbLaw(); isec++) { for (Standard_Integer isec=1; isec<=myLocation->NbLaw(); isec++) {
Loc = Handle(GeomFill_LocationGuide)::DownCast(myLocation->Law(isec)); Loc = Handle(GeomFill_LocationGuide)::DownCast(myLocation->Law(isec));
Loc->EraseRotation();// on supprime la rotation Loc->EraseRotation();// remove the rotation
} }
} }
} }

View File

@ -30,7 +30,7 @@
//======================================================================= //=======================================================================
//function : NbLaw //function : NbLaw
//purpose : Donne le nombre de loi elementaire (ou Geometrique) //purpose : Gives the number of elementary (or Geometric) law
//======================================================================= //=======================================================================
Standard_Integer BRepFill_SectionLaw::NbLaw() const Standard_Integer BRepFill_SectionLaw::NbLaw() const
{ {
@ -68,7 +68,7 @@
//======================================================================= //=======================================================================
//function : Init //function : Init
//purpose : Prepare le parcour d'un wire //purpose : Prepare the parsing of a wire
//======================================================================= //=======================================================================
void BRepFill_SectionLaw::Init(const TopoDS_Wire& W) void BRepFill_SectionLaw::Init(const TopoDS_Wire& W)
{ {
@ -77,7 +77,7 @@
//======================================================================= //=======================================================================
//function : //function :
//purpose : Parcourt d'un wire en sautant les Edges degenere //purpose : Parses the wire omitting the degenerated Edges
//======================================================================= //=======================================================================
TopoDS_Edge BRepFill_SectionLaw::CurrentEdge() TopoDS_Edge BRepFill_SectionLaw::CurrentEdge()
{ {
@ -87,14 +87,14 @@
Standard_Boolean Suivant = Standard_False; Standard_Boolean Suivant = Standard_False;
if (myIterator.More()) { if (myIterator.More()) {
E = myIterator.Current(); E = myIterator.Current();
// Suivant = (B.Degenerated(E)); // Next = (B.Degenerated(E));
Suivant = (BRep_Tool::Degenerated(E)); Suivant = (BRep_Tool::Degenerated(E));
} }
while (Suivant) { while (Suivant) {
myIterator.Next(); myIterator.Next();
E = myIterator.Current(); E = myIterator.Current();
// Suivant = (B.Degenerated(E) && myIterator.More()); // Next = (B.Degenerated(E) && myIterator.More());
Suivant = (BRep_Tool::Degenerated(E) && myIterator.More()); Suivant = (BRep_Tool::Degenerated(E) && myIterator.More());
} }

View File

@ -144,7 +144,7 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
// modified by NIZHNY-629 Fri Jul 25 11:10:27 2003 b // modified by NIZHNY-629 Fri Jul 25 11:10:27 2003 b
// // section ponctuelle // // punctual section
// Ex.Init(mySection, TopAbs_EDGE); // Ex.Init(mySection, TopAbs_EDGE);
// Standard_Boolean isPonctual = Standard_False; // Standard_Boolean isPonctual = Standard_False;
// if (Ex.More()) { // if (Ex.More()) {
@ -270,7 +270,7 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
GeomFill_SectionPlacement Place(myLaw->Law(1), theSection); GeomFill_SectionPlacement Place(myLaw->Law(1), theSection);
// Dans le cas generale : Localisation via une concatenation de la spine // In the general case : Localisation via concatenation of the spine
TColStd_Array1OfReal SuperKnot(1, myLaw->NbLaw()+1); TColStd_Array1OfReal SuperKnot(1, myLaw->NbLaw()+1);
TColStd_Array1OfInteger Index(1, myLaw->NbLaw()); TColStd_Array1OfInteger Index(1, myLaw->NbLaw());
for (ii=1; ii<=myLaw->NbLaw(); ii++) { for (ii=1; ii<=myLaw->NbLaw(); ii++) {
@ -310,7 +310,7 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
Ind1 = Index(Ind1); Ind1 = Index(Ind1);
if (Ind2) Ind2 = Index(Ind2); if (Ind2) Ind2 = Index(Ind2);
// Positionnement sur l'edge (ou les 2 Edges) localisee(s) // Positioning on the localized edge (or 2 Edges)
Standard_Real Angle; Standard_Real Angle;
Place.SetLocation(myLaw->Law(Ind1)); Place.SetLocation(myLaw->Law(Ind1));
if(TheV.IsNull()) if(TheV.IsNull())

View File

@ -33,8 +33,8 @@
//======================================================================= //=======================================================================
//function : Create //function : Create
//purpose : On traite le cas du Vertex en construisant, une line, //purpose : Process the case of Vertex by constructing a line
// ayant le vertex pour origine // with the vertex in the origin
//======================================================================= //=======================================================================
BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Vertex& V, BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Vertex& V,
const Standard_Boolean Build) const Standard_Boolean Build)
@ -43,14 +43,14 @@ BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Vertex& V,
{ {
TheLaw.Nullify(); TheLaw.Nullify();
uclosed = Standard_False; uclosed = Standard_False;
vclosed = Standard_True; // loi constante vclosed = Standard_True; // constant law
myEdges = new (TopTools_HArray1OfShape) (1, 1); myEdges = new (TopTools_HArray1OfShape) (1, 1);
myEdges->SetValue(1, V); myEdges->SetValue(1, V);
if (Build) { if (Build) {
myLaws = new (GeomFill_HArray1OfSectionLaw) (1, 1); myLaws = new (GeomFill_HArray1OfSectionLaw) (1, 1);
// gp_Pnt Origine; // gp_Pnt Origine;
gp_Dir D(1,0,0); //Suivant la normal gp_Dir D(1,0,0); //Following the normal
Handle(Geom_Line) L = new (Geom_Line)(BRep_Tool::Pnt(V), D); Handle(Geom_Line) L = new (Geom_Line)(BRep_Tool::Pnt(V), D);
Standard_Real Last = 2*BRep_Tool::Tolerance(V)+Precision::PConfusion(); Standard_Real Last = 2*BRep_Tool::Tolerance(V)+Precision::PConfusion();
Handle(Geom_TrimmedCurve) TC = new (Geom_TrimmedCurve) (L, 0, Last); Handle(Geom_TrimmedCurve) TC = new (Geom_TrimmedCurve) (L, 0, Last);
@ -78,7 +78,7 @@ BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Wire& W,
//======================================================================= //=======================================================================
//function : Create //function : Create
//purpose : Wire evolutif //purpose : Evolutive Wire
//======================================================================= //=======================================================================
BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Wire& W, BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Wire& W,
@ -94,7 +94,7 @@ BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Wire& W,
//======================================================================= //=======================================================================
//function : Init //function : Init
//purpose : Cas du wire : On cree une table de GeomFill_SectionLaw //purpose : Case of the wire : Create a table of GeomFill_SectionLaw
//======================================================================= //=======================================================================
void BRepFill_ShapeLaw::Init(const Standard_Boolean Build) void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
{ {
@ -132,7 +132,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
if (E.Orientation() == TopAbs_REVERSED) { if (E.Orientation() == TopAbs_REVERSED) {
Standard_Real aux; Standard_Real aux;
Handle(Geom_Curve) CBis; Handle(Geom_Curve) CBis;
CBis = C->Reversed(); // Pour eviter de deteriorer la topologie CBis = C->Reversed(); // To avoid the deterioration of the topology
aux = C->ReversedParameter(First); aux = C->ReversedParameter(First);
First = C->ReversedParameter(Last); First = C->ReversedParameter(Last);
Last = aux; Last = aux;
@ -152,11 +152,11 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
} }
} }
if ((ii>1) || !IsReallyClosed ) { // On trimme C if ((ii>1) || !IsReallyClosed ) { // Trim C
Handle(Geom_TrimmedCurve) TC = new Geom_TrimmedCurve(C,First, Last); Handle(Geom_TrimmedCurve) TC = new Geom_TrimmedCurve(C,First, Last);
C = TC; C = TC;
} }
// sinon On garde l'integrite de la courbe // otherwise preserve the integrity of the curve
if (TheLaw.IsNull()) { if (TheLaw.IsNull()) {
myLaws->ChangeValue(ii) = new GeomFill_UniformSection(C); myLaws->ChangeValue(ii) = new GeomFill_UniformSection(C);
} }
@ -171,10 +171,10 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
// cout << "new law" << endl; // cout << "new law" << endl;
// La loi est elle ferme en U ? // Is the law closed by U ?
uclosed = W.Closed(); uclosed = W.Closed();
if (!uclosed) { if (!uclosed) {
// le flag n'etant pas tres sur, on fait une verif // if not sure about the flag, make check
TopoDS_Edge Edge1, Edge2; TopoDS_Edge Edge1, Edge2;
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
Edge1 = TopoDS::Edge (myEdges->Value(myEdges->Length())); Edge1 = TopoDS::Edge (myEdges->Value(myEdges->Length()));
@ -263,7 +263,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
///======================================================================= ///=======================================================================
//function : VertexTol //function : VertexTol
//purpose : Evalue le trou entre 2 edges de la section //purpose : Evaluate the hole between 2 edges of the section
//======================================================================= //=======================================================================
Standard_Real BRepFill_ShapeLaw::VertexTol(const Standard_Integer Index, Standard_Real BRepFill_ShapeLaw::VertexTol(const Standard_Integer Index,
const Standard_Real Param) const const Standard_Real Param) const
@ -271,7 +271,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
Standard_Real Tol = Precision::Confusion(); Standard_Real Tol = Precision::Confusion();
Standard_Integer I1, I2; Standard_Integer I1, I2;
if ( (Index==0) || (Index==myEdges->Length()) ) { if ( (Index==0) || (Index==myEdges->Length()) ) {
if (!uclosed) return Tol; //Le moins faux possible if (!uclosed) return Tol; //The least possible error
I1 = myEdges->Length(); I1 = myEdges->Length();
I2 = 1; I2 = 1;
} }
@ -339,7 +339,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
TopoDS_Vertex V; TopoDS_Vertex V;
W = TopoDS::Wire(myShape); W = TopoDS::Wire(myShape);
if(!W.IsNull()) { if(!W.IsNull()) {
// Concatenation des aretes // Concatenation of edges
Standard_Integer ii; Standard_Integer ii;
Standard_Real epsV, f, l; Standard_Real epsV, f, l;
Standard_Boolean Bof; Standard_Boolean Bof;
@ -388,7 +388,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build)
TopoDS_Edge Edge1, Edge2; TopoDS_Edge Edge1, Edge2;
if ( (Index==0) || (Index==myEdges->Length()) ) { if ( (Index==0) || (Index==myEdges->Length()) ) {
if (!uclosed) return GeomAbs_C0; //Le moins faux possible if (!uclosed) return GeomAbs_C0; //The least possible error
Edge1 = TopoDS::Edge (myEdges->Value(myEdges->Length())); Edge1 = TopoDS::Edge (myEdges->Value(myEdges->Length()));
Edge2 = TopoDS::Edge (myEdges->Value(1)); Edge2 = TopoDS::Edge (myEdges->Value(1));

View File

@ -192,7 +192,7 @@ static Standard_Boolean HasPCurves(const TopoDS_Edge& E)
//======================================================================= //=======================================================================
//function : Translate //function : Translate
//purpose : Copy une colonne d'un tableau dans un autre. //purpose : Copy a column from one table to another.
//======================================================================= //=======================================================================
static void Translate(const Handle(TopTools_HArray2OfShape)& ArrayIn, static void Translate(const Handle(TopTools_HArray2OfShape)& ArrayIn,
const Standard_Integer In, const Standard_Integer In,
@ -209,7 +209,7 @@ static void Translate(const Handle(TopTools_HArray2OfShape)& ArrayIn,
//======================================================================= //=======================================================================
//function : Box //function : Box
//purpose : Boite d'encombrement d'une section. //purpose : Bounding box of a section.
//======================================================================= //=======================================================================
static void Box(Handle(GeomFill_SectionLaw)& Sec, static void Box(Handle(GeomFill_SectionLaw)& Sec,
const Standard_Real U, const Standard_Real U,
@ -229,8 +229,8 @@ static void Box(Handle(GeomFill_SectionLaw)& Sec,
//======================================================================= //=======================================================================
//function : Couture //function : Couture
//purpose : Controle si E est une arete de couture sur S //purpose : Check if E is an edge of sewing on S
// et rend la representation HadHoc // and make the representation HadHoc
//======================================================================= //=======================================================================
static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E, static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
const Handle(Geom_Surface)& S, const Handle(Geom_Surface)& S,
@ -261,7 +261,7 @@ static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : CheckSameParameter //function : CheckSameParameter
//purpose : Controle a posteriori que sameparameter a bien fait son boulot //purpose : Check a posteriori that sameparameter has worked correctly
//======================================================================= //=======================================================================
static Standard_Boolean CheckSameParameter static Standard_Boolean CheckSameParameter
@ -298,9 +298,9 @@ static Standard_Boolean CheckSameParameter
//======================================================================= //=======================================================================
//function : SameParameter //function : SameParameter
//purpose : Encapsulation de Sameparameter //purpose : Encapsulation of Sameparameter
// Le boolean dit si l'on a calcule la pcurve ou non... // Boolean informs if the pcurve was computed or not...
// La tolerance est toujours Ok. // The tolerance is always OK.
//======================================================================= //=======================================================================
static Standard_Boolean SameParameter(TopoDS_Edge& E, static Standard_Boolean SameParameter(TopoDS_Edge& E,
@ -348,8 +348,8 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
ResTol = sp.TolReached(); ResTol = sp.TolReached();
if(ResTol > tolreached ){ if(ResTol > tolreached ){
#ifdef DEB #ifdef DEB
cout<<"SameParameter : Tol non atteinte!!!"<<endl; cout<<"SameParameter : Tolerance not reached!"<<endl;
cout<<"tol visee : "<<tol3d<<" tol obtenue : "<<ResTol<<endl; cout<<"tol visee : "<<tol3d<<" tol obtained : "<<ResTol<<endl;
#endif #endif
return Standard_False; return Standard_False;
} }
@ -361,8 +361,8 @@ static Standard_Boolean SameParameter(TopoDS_Edge& E,
} }
//======================================================================= //=======================================================================
//Objet : Oriente une arete de restriction naturelle //Objet : Orientate an edge of natural restriction
// : Cas generale // : General
//======================================================================= //=======================================================================
static void Oriente(const Handle(Geom_Surface)& S, static void Oriente(const Handle(Geom_Surface)& S,
TopoDS_Edge& E) TopoDS_Edge& E)
@ -417,10 +417,10 @@ static void UpdateEdgeOnPlane(const TopoDS_Face& F, const TopoDS_Edge& E,
//<-OCC500(apo) //<-OCC500(apo)
//======================================================================= //=======================================================================
//Function : BuildFace //Function : BuildFace
//Objet : Construire une Face via, une surface et 4 Edge( Bords naturels) //Objet : Construct a Face via a surface and 4 Edges (natural borders)
// : Seule Hypothese : les iso u et v sont alternee : // : Only one Hypothesis : isos u and v are switched :
// Edge1/3 sont des iso u (recp v) // Edge1/3 are iso u (recp v)
// Edge2/4 sont des iso v (recp u) // Edge2/4 are iso v (recp u)
//======================================================================= //=======================================================================
static void BuildFace(const Handle(Geom_Surface)& S, static void BuildFace(const Handle(Geom_Surface)& S,
const TopoDS_Edge& E1, const TopoDS_Edge& E1,
@ -442,7 +442,7 @@ static void BuildFace(const Handle(Geom_Surface)& S,
TopoDS_Iterator Iter; TopoDS_Iterator Iter;
//gp_Pnt2d P; //gp_Pnt2d P;
//La surface est elle plane ? //Is the surface planar ?
Standard_Real Tol1, Tol2, Tol3, Tol4; Standard_Real Tol1, Tol2, Tol3, Tol4;
Tol1 = BRep_Tool::Tolerance( E1 ); Tol1 = BRep_Tool::Tolerance( E1 );
Tol2 = BRep_Tool::Tolerance( E2 ); Tol2 = BRep_Tool::Tolerance( E2 );
@ -492,7 +492,7 @@ static void BuildFace(const Handle(Geom_Surface)& S,
} }
} }
// Construction du wire // Construction of the wire
// B.MakeWire(WW); // B.MakeWire(WW);
e1 = E1; e1 = E1;
Oriente(S, e1); Oriente(S, e1);
@ -575,9 +575,9 @@ static void BuildFace(const Handle(Geom_Surface)& S,
} }
#endif #endif
// Construction de la face. // Construction of the face.
if (IsPlan) { // On vire les representation 2d if (IsPlan) { // Suspend representation 2d
// et on constuit une face Plane // and construct face Plane
//BRepLib_MakeFace MkF(IsP.Plan(), WW); //BRepLib_MakeFace MkF(IsP.Plan(), WW);
gp_Pnt aPnt; gp_Pnt aPnt;
@ -638,7 +638,7 @@ static void BuildFace(const Handle(Geom_Surface)& S,
//======================================================================= //=======================================================================
//Fonction : BuildEdge //Fonction : BuildEdge
//Objet : Construit une Edge non fermee //Objet : Construct non-closed Edge
//======================================================================= //=======================================================================
static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d, static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
Handle(Geom2d_Curve)& C2d, Handle(Geom2d_Curve)& C2d,
@ -668,7 +668,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
if (VF.IsSame(VL) || if (VF.IsSame(VL) ||
(P1.Distance(P2) < Tol ) ) { (P1.Distance(P2) < Tol ) ) {
// Cas degenere // Degenerated case
gp_Pnt2d P2d; gp_Pnt2d P2d;
C2d->D0(f, P2d); C2d->D0(f, P2d);
S->D0(P2d.X(), P2d.Y(), P); S->D0(P2d.X(), P2d.Y(), P);
@ -705,7 +705,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
B.UpdateVertex(VL, d); B.UpdateVertex(VL, d);
BRepLib_MakeEdge MkE (C3d, VF, VL, f, l); BRepLib_MakeEdge MkE (C3d, VF, VL, f, l);
if (!MkE.IsDone()) { // Erreur de construction !! if (!MkE.IsDone()) { // Error of construction !!
#ifdef DRAW #ifdef DRAW
char name[100]; char name[100];
sprintf(name,"firstvertex_error"); sprintf(name,"firstvertex_error");
@ -730,7 +730,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d,
//======================================================================= //=======================================================================
//Fonction : Filling //Fonction : Filling
//Objet : Construit les faces de remplisage //Objet : Construct the faces of filling
//======================================================================= //=======================================================================
static Standard_Boolean Filling(const TopoDS_Shape& EF, static Standard_Boolean Filling(const TopoDS_Shape& EF,
const TopoDS_Shape& F1, const TopoDS_Shape& F1,
@ -751,7 +751,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
// Standard_Real Tol3d = Tol; // Standard_Real Tol3d = Tol;
Standard_Boolean WithE3, WithE4; Standard_Boolean WithE3, WithE4;
// Recuperation des contraintes // Return constraints
TopoDS_Vertex V1, V2, Vf, Vl; TopoDS_Vertex V1, V2, Vf, Vl;
TopoDS_Edge E1, E2, E3, E4; TopoDS_Edge E1, E2, E3, E4;
E1 = TopoDS::Edge(EF); E1 = TopoDS::Edge(EF);
@ -798,7 +798,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
} }
#endif #endif
// Construction d'une surface de revolution // Construction of a surface of revolution
Handle(Geom_Curve) Prof1, Prof2; Handle(Geom_Curve) Prof1, Prof2;
//Standard_Integer ii, jj;//, Nb; //Standard_Integer ii, jj;//, Nb;
Standard_Real f1, f2, l1, l2,/*d1, d2,*/ Angle;//, Eps = 1.e-9; Standard_Real f1, f2, l1, l2,/*d1, d2,*/ Angle;//, Eps = 1.e-9;
@ -811,7 +811,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
gp_Trsf Tf; gp_Trsf Tf;
Tf.SetTransformation(Axe); Tf.SetTransformation(Axe);
// Choix d'un angle d'ouverture // Choose the angle of opening
P1 = Prof1->Value((f1+l1)/2); P1 = Prof1->Value((f1+l1)/2);
P2 = Prof2->Value((f2+l2)/2); P2 = Prof2->Value((f2+l2)/2);
P1.Transform(Tf); P1.Transform(Tf);
@ -838,11 +838,11 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
Handle(Geom_Surface) Surf = Handle(Geom_Surface) Surf =
new (Geom_RectangularTrimmedSurface) (Rev, 0, Angle, f1, l1); new (Geom_RectangularTrimmedSurface) (Rev, 0, Angle, f1, l1);
// Controle le sens de la rotation // Control the direction of the rotation
Standard_Boolean ToReverseResult = Standard_False; Standard_Boolean ToReverseResult = Standard_False;
gp_Vec d1u; gp_Vec d1u;
d1u = Surf->DN(0, (f1+l1)/2, 1, 0); d1u = Surf->DN(0, (f1+l1)/2, 1, 0);
if (d1u.Angle(TangentOnPart1) > PI/2) { //On inverse tout if (d1u.Angle(TangentOnPart1) > PI/2) { //Invert everything
ToReverseResult = Standard_True; ToReverseResult = Standard_True;
/* /*
axe.Reverse(); axe.Reverse();
@ -862,7 +862,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
Handle(Geom2d_Curve) C1, C2, C3, C4; Handle(Geom2d_Curve) C1, C2, C3, C4;
/* /*
// Deformation de la surface de revolution. // Deform the surface of revolution.
GeomPlate_BuildPlateSurface BPS; GeomPlate_BuildPlateSurface BPS;
Handle(BRepAdaptor_HSurface) AS; Handle(BRepAdaptor_HSurface) AS;
@ -879,7 +879,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
L = new (Geom2d_Line) (P2d, gp::DY2d()); L = new (Geom2d_Line) (P2d, gp::DY2d());
C2 = new (Geom2d_TrimmedCurve) (L, f1, l1); C2 = new (Geom2d_TrimmedCurve) (L, f1, l1);
// Ici il faut controler le sens et le range. // It is required to control the direction and the range.
C2->D0(f1, P2d); C2->D0(f1, P2d);
Surf->D0(P2d.X(), P2d.Y(), P1); Surf->D0(P2d.X(), P2d.Y(), P1);
C2->D0(l1, P2d); C2->D0(l1, P2d);
@ -887,7 +887,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
// P = BT.Pnt(V1); // P = BT.Pnt(V1);
P = BRep_Tool::Pnt(V1); P = BRep_Tool::Pnt(V1);
if (P.Distance(P2)+Tol < P.Distance(P1)) { if (P.Distance(P2)+Tol < P.Distance(P1)) {
// E2 est (sans doute!) parcourue dans le sens inverse de E1 // E2 is parsed in the direction opposite to E1
C2->Reverse(); C2->Reverse();
TopoDS_Vertex aux; TopoDS_Vertex aux;
aux = V2; aux = V2;
@ -924,8 +924,8 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
L = new (Geom2d_Line) (P2d, gp::DX2d()); L = new (Geom2d_Line) (P2d, gp::DX2d());
C4 = new (Geom2d_TrimmedCurve) (L, 0, Angle); C4 = new (Geom2d_TrimmedCurve) (L, 0, Angle);
/* /*
// Determination des contraintes et // Determine the constraints and
// de leur localisation parametrique. // their parametric localisation.
if (!E1.IsNull()) { if (!E1.IsNull()) {
AS = new BRepAdaptor_HSurface(TopoDS::Face(F1)); AS = new BRepAdaptor_HSurface(TopoDS::Face(F1));
AC2d = new BRepAdaptor_HCurve2d(); AC2d = new BRepAdaptor_HCurve2d();
@ -1113,16 +1113,16 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
} }
} }
//Construction de la face //Construct face
BuildFace(Surf,E1, E3, E2, E4, EEmap, BuildFace(Surf,E1, E3, E2, E4, EEmap,
Standard_False, Standard_False, Standard_False, Standard_False,
Result); Result);
// Set Les continuites. // Set the continuities.
B.Continuity(E1, TopoDS::Face(F1), Result, GeomAbs_G1); B.Continuity(E1, TopoDS::Face(F1), Result, GeomAbs_G1);
B.Continuity(E2, TopoDS::Face(F2), Result, GeomAbs_G1); B.Continuity(E2, TopoDS::Face(F2), Result, GeomAbs_G1);
// Rend les bords calcules. // Render the calculated borders.
// if (!BT.Degenerated(E3)) // if (!BT.Degenerated(E3))
if (!BRep_Tool::Degenerated(E3)) if (!BRep_Tool::Degenerated(E3))
Aux1 = E3; Aux1 = E3;
@ -1135,7 +1135,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF,
else else
B.MakeEdge(Aux2); B.MakeEdge(Aux2);
// Set de l'orientation // Set the orientation
gp_Vec D1U, D1V, N1, N2; gp_Vec D1U, D1V, N1, N2;
C1->D0( (f1+l1)/2, P2d); C1->D0( (f1+l1)/2, P2d);
Surf->D1(P2d.X(), P2d.Y(), P, D1U, D1V); Surf->D1(P2d.X(), P2d.Y(), P, D1U, D1V);
@ -1197,7 +1197,7 @@ static void Substitute(BRepTools_Substitution& aSubstitute,
//======================================================================= //=======================================================================
//Function : SetCommonEdgeInFace //Function : SetCommonEdgeInFace
//Purpose : Replace an edge of the face by correspondent edge from //Purpose : Replace an edge of the face by the corresponding edge from
// myUEdges // myUEdges
//======================================================================= //=======================================================================
/* /*
@ -1236,7 +1236,7 @@ static void SetCommonEdgeInFace(BRepTools_Substitution& aSubstitute,
//======================================================================= //=======================================================================
//Fonction : KeepEdge //Fonction : KeepEdge
//Objet : Recheche les edges de la face supporte par la meme Courbe. //Objet : Find edges of the face supported by the same Curve.
//======================================================================= //=======================================================================
static void KeepEdge(const TopoDS_Shape& Face, static void KeepEdge(const TopoDS_Shape& Face,
const TopoDS_Shape& Edge, const TopoDS_Shape& Edge,
@ -1263,7 +1263,7 @@ static void KeepEdge(const TopoDS_Shape& Face,
//======================================================================= //=======================================================================
//Function : //Function :
//Objet : Construire un vertex via, une iso //Objet : Construct a vertex via an iso
//======================================================================= //=======================================================================
static void BuildVertex(const Handle(Geom_Curve)& Iso, static void BuildVertex(const Handle(Geom_Curve)& Iso,
const Standard_Boolean isfirst, const Standard_Boolean isfirst,
@ -1283,7 +1283,7 @@ static void BuildVertex(const Handle(Geom_Curve)& Iso,
//======================================================================= //=======================================================================
//Function : //Function :
//Objet : Construire une arete vide //Objet : Construct an empty edge
//======================================================================= //=======================================================================
static TopoDS_Edge NullEdge(TopoDS_Shape& Vertex) static TopoDS_Edge NullEdge(TopoDS_Shape& Vertex)
{ {
@ -1300,7 +1300,7 @@ static TopoDS_Edge NullEdge(TopoDS_Shape& Vertex)
//======================================================================= //=======================================================================
//Function : //Function :
//Objet : Construire une arete via, une iso //Objet : Construct an edge via an iso
//======================================================================= //=======================================================================
static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S, static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
const Standard_Boolean isUiso, const Standard_Boolean isUiso,
@ -1320,7 +1320,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
Iso = S->VIso(ValIso); Iso = S->VIso(ValIso);
} }
if (VFirst.IsSame(VLast)) { // Cas Singulier ? if (VFirst.IsSame(VLast)) { // Singular case ?
gp_Pnt P; gp_Pnt P;
// Class BRep_Tool without fields and without Constructor : // Class BRep_Tool without fields and without Constructor :
// BRep_Tool BT; // BRep_Tool BT;
@ -1337,7 +1337,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
} }
if (sing) { // Cas Singulier if (sing) { // Singular case
TopoDS_Shape V; TopoDS_Shape V;
V = VFirst; V = VFirst;
E = NullEdge(V); E = NullEdge(V);
@ -1347,7 +1347,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
} }
else { else {
// Construction Via le 3d // Construction Via 3d
// if (isUiso) { // if (isUiso) {
// Iso = S->UIso(ValIso); // Iso = S->UIso(ValIso);
gp_Pnt P1,P2; gp_Pnt P1,P2;
@ -1426,7 +1426,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
E = MkE.Edge(); E = MkE.Edge();
} }
// On associe le 2d // Associate 2d
Handle(Geom2d_Line) L; Handle(Geom2d_Line) L;
TopLoc_Location Loc; TopLoc_Location Loc;
if (isUiso) { if (isUiso) {
@ -1450,7 +1450,7 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
//======================================================================= //=======================================================================
//Function : //Function :
//Objet : Completer une arete via, une iso //Objet : Complete an edge via an iso
//======================================================================= //=======================================================================
static void UpdateEdge(TopoDS_Edge& E, static void UpdateEdge(TopoDS_Edge& E,
const Handle(Geom_Surface)& S, const Handle(Geom_Surface)& S,
@ -1475,7 +1475,7 @@ static void UpdateEdge(TopoDS_Edge& E,
TopoDS_Vertex Vf, Vl; TopoDS_Vertex Vf, Vl;
TopExp::Vertices(E, Vf, Vl); TopExp::Vertices(E, Vf, Vl);
if (Vf.IsSame(Vl)) { // Cas Singulier ? if (Vf.IsSame(Vl)) { // Singular case ?
gp_Pnt Pmid; gp_Pnt Pmid;
Standard_Real tol = BRep_Tool::Tolerance(Vf); Standard_Real tol = BRep_Tool::Tolerance(Vf);
Iso->D0((Iso->FirstParameter()+Iso->LastParameter())/2, Pmid); Iso->D0((Iso->FirstParameter()+Iso->LastParameter())/2, Pmid);
@ -1501,7 +1501,7 @@ static void UpdateEdge(TopoDS_Edge& E,
} }
CL = new (Geom2d_TrimmedCurve) (L, F2d, L2d); CL = new (Geom2d_TrimmedCurve) (L, F2d, L2d);
// Controle sens & Range // Control direction & Range
Standard_Real R, First, Last, Tol=1.e-4; Standard_Real R, First, Last, Tol=1.e-4;
Standard_Boolean reverse = Standard_False;; Standard_Boolean reverse = Standard_False;;
@ -1514,14 +1514,14 @@ static void UpdateEdge(TopoDS_Edge& E,
BRep_Tool::Range(E, First, Last); BRep_Tool::Range(E, First, Last);
if (!Vf.IsSame(Vl)) { if (!Vf.IsSame(Vl)) {
// On test les distance entre le "FirstPoint et les Vertex" // Test distances between "FirstPoint" and "Vertex"
P2d = CL->Value(F2d); P2d = CL->Value(F2d);
POnS = S->Value(P2d.X(), P2d.Y()); POnS = S->Value(P2d.X(), P2d.Y());
// reverse = POnS.Distance(BT.Pnt(Vl)) < POnS.Distance(BT.Pnt(Vf)); // reverse = POnS.Distance(BT.Pnt(Vl)) < POnS.Distance(BT.Pnt(Vf));
reverse = POnS.Distance(BRep_Tool::Pnt(Vl)) < POnS.Distance(BRep_Tool::Pnt(Vf)); reverse = POnS.Distance(BRep_Tool::Pnt(Vl)) < POnS.Distance(BRep_Tool::Pnt(Vf));
} }
else if (!sing) { else if (!sing) {
// On test l'angle entre les "First Tangente" // Test angle between "First Tangente"
gp_Vec2d V2d; gp_Vec2d V2d;
gp_Vec V3d, du, dv, dC3d; gp_Vec V3d, du, dv, dC3d;
BRepAdaptor_Curve C3d(E); BRepAdaptor_Curve C3d(E);
@ -1532,7 +1532,7 @@ static void UpdateEdge(TopoDS_Edge& E,
V3d.SetLinearForm(V2d.X(), du, V2d.Y(), dv); V3d.SetLinearForm(V2d.X(), du, V2d.Y(), dv);
reverse = ( dC3d.Angle(V3d) > Tol); reverse = ( dC3d.Angle(V3d) > Tol);
} }
if (reverse ) { // On retourne la courbe 2d if (reverse ) { // Return curve 2d
CL = new (Geom2d_TrimmedCurve)(L, F2d, L2d); CL = new (Geom2d_TrimmedCurve)(L, F2d, L2d);
CL->Reverse(); CL->Reverse();
F2d = CL->FirstParameter(); F2d = CL->FirstParameter();
@ -1575,7 +1575,7 @@ static void UpdateEdge(TopoDS_Edge& E,
R = POnS.Distance(BRep_Tool::Pnt(V)); R = POnS.Distance(BRep_Tool::Pnt(V));
B.UpdateVertex(V, R); B.UpdateVertex(V, R);
// Update de l'Edge // Update Edge
if (!sing && SameParameter(E, CL, S, Tol, R)) { if (!sing && SameParameter(E, CL, S, Tol, R)) {
B.UpdateEdge(E, R); B.UpdateEdge(E, R);
} }
@ -1583,7 +1583,7 @@ static void UpdateEdge(TopoDS_Edge& E,
PCurve = Couture(E, S, Loc); PCurve = Couture(E, S, Loc);
if (PCurve.IsNull()) if (PCurve.IsNull())
B.UpdateEdge(E, CL, S, Loc, Precision::Confusion()); B.UpdateEdge(E, CL, S, Loc, Precision::Confusion());
else { // Arete de couture else { // Sewing edge
TopoDS_Edge e = E; TopoDS_Edge e = E;
Oriente(S, e); Oriente(S, e);
if (e.Orientation() == TopAbs_REVERSED) if (e.Orientation() == TopAbs_REVERSED)
@ -1592,13 +1592,13 @@ static void UpdateEdge(TopoDS_Edge& E,
B.UpdateEdge(E, PCurve, CL, S, Loc, Precision::Confusion()); B.UpdateEdge(E, PCurve, CL, S, Loc, Precision::Confusion());
} }
// Attention au cas non SameRange sur ces shapes (PRO13551) // Attention to case not SameRange on its shapes (PRO13551)
// if (!BT.SameRange(E)) B.Range(E, S, Loc, First, Last); // if (!BT.SameRange(E)) B.Range(E, S, Loc, First, Last);
if (!BRep_Tool::SameRange(E)) B.Range(E, S, Loc, First, Last); if (!BRep_Tool::SameRange(E)) B.Range(E, S, Loc, First, Last);
} }
//======================================================================= //=======================================================================
//Objet : Voir si une surface est degenere // Object : Check if a surface is degenerated
//======================================================================= //=======================================================================
static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S, static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
const Standard_Real Tol) const Standard_Real Tol)
@ -1613,7 +1613,7 @@ static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
S->Bounds(Umin, Umax, Vmin, Vmax); S->Bounds(Umin, Umax, Vmin, Vmax);
// Controle la longeur des Iso-U // Check the length of Iso-U
t = (Umin + Umax)/2; t = (Umin + Umax)/2;
S->D0(t, Vmin, P1); S->D0(t, Vmin, P1);
S->D0(t, (Vmin+Vmax)/2, P2); S->D0(t, (Vmin+Vmax)/2, P2);
@ -1630,7 +1630,7 @@ static Standard_Boolean IsDegen(const Handle(Geom_Surface)& S,
if (B) return Standard_True; if (B) return Standard_True;
// Controle la longeur des Iso-V // Check the length of Iso-V
t = (Vmin + Vmax)/2; t = (Vmin + Vmax)/2;
S->D0(Umin, t, P1); S->D0(Umin, t, P1);
S->D0((Umin+Umax)/2, t, P2); S->D0((Umin+Umax)/2, t, P2);
@ -1676,7 +1676,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : SetBounds //function : SetBounds
//purpose : Definit les shapes de debut et fin //purpose : Define start and end shapes
//====================================================================== //======================================================================
void BRepFill_Sweep::SetBounds(const TopoDS_Wire& First, void BRepFill_Sweep::SetBounds(const TopoDS_Wire& First,
const TopoDS_Wire& Last) const TopoDS_Wire& Last)
@ -1684,7 +1684,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
FirstShape = First; FirstShape = First;
LastShape = Last; LastShape = Last;
// Il faut verifier le SameRange sur ces shapes (PRO13551) // It is necessary to check the SameRange on its (PRO13551)
Standard_Boolean issame = Standard_True; Standard_Boolean issame = Standard_True;
BRep_Builder B; BRep_Builder B;
BRepTools_WireExplorer wexp; BRepTools_WireExplorer wexp;
@ -1710,7 +1710,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
#if DEB #if DEB
if (!issame) if (!issame)
cout<<"Sweep Warning : Edge non SameRange dans les bornes"<<endl; cout<<"Sweep Warning : Edge not SameRange in the limits"<<endl;
#endif #endif
} }
@ -1772,7 +1772,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : BuildWire //function : BuildWire
//purpose : Construit un wire par balayage //purpose : Construit a wire by sweeping
//====================================================================== //======================================================================
Standard_Boolean BRepFill_Sweep:: Standard_Boolean BRepFill_Sweep::
BuildWire(const BRepFill_TransitionStyle /*Transition*/) BuildWire(const BRepFill_TransitionStyle /*Transition*/)
@ -1795,16 +1795,16 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
TopoDS_Edge E; TopoDS_Edge E;
B.MakeWire(wire); B.MakeWire(wire);
// (1) Construction de toutes les courbes // (1) Construction of all curves
// (1.1) Construction des Tables // (1.1) Construction of Tables
myFaces = new (TopTools_HArray2OfShape) (1, 1, 1, NbPath); myFaces = new (TopTools_HArray2OfShape) (1, 1, 1, NbPath);
myUEdges = new (TopTools_HArray2OfShape) (1, 2, 1, NbPath); myUEdges = new (TopTools_HArray2OfShape) (1, 2, 1, NbPath);
myVEdges = new (TopTools_HArray2OfShape) (1, 1, 1, NbPath+1); myVEdges = new (TopTools_HArray2OfShape) (1, 1, 1, NbPath+1);
// (1.2) Calcul des courbes / vertex / edge // (1.2) Calculate curves / vertex / edge
for (ipath=1; ipath <=NbPath; ipath++) { for (ipath=1; ipath <=NbPath; ipath++) {
// Courbe par iso valeur // Curve by iso value
GeomFill_Sweep Sweep(myLoc->Law(ipath), KPart); GeomFill_Sweep Sweep(myLoc->Law(ipath), KPart);
Sweep.SetTolerance(myTol3d, myBoundTol, myTol2d, myTolAngular); Sweep.SetTolerance(myTol3d, myBoundTol, myTol2d, myTolAngular);
Sweep.Build(mySec->Law(isec), myApproxStyle, myContinuity, myDegmax, mySegmax); Sweep.Build(mySec->Law(isec), myApproxStyle, myContinuity, myDegmax, mySegmax);
@ -1821,7 +1821,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
else S->Bounds(val, bid, First, Last); else S->Bounds(val, bid, First, Last);
Iso = S->UIso(val); Iso = S->UIso(val);
} }
// Vertex par positionement // Vertex by position
if (ipath < NbPath) if (ipath < NbPath)
BuildVertex(Iso, Standard_False, First, Last, BuildVertex(Iso, Standard_False, First, Last,
myVEdges->ChangeValue(1, ipath+1)); myVEdges->ChangeValue(1, ipath+1));
@ -1854,14 +1854,14 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
myVEdges->ChangeValue(1, 1)); myVEdges->ChangeValue(1, 1));
} }
// Construction de l'arete // Construction of the edge
BRepLib_MakeEdge MkE; BRepLib_MakeEdge MkE;
MkE.Init(Iso, MkE.Init(Iso,
TopoDS::Vertex(myVEdges->Value(1, ipath)), TopoDS::Vertex(myVEdges->Value(1, ipath)),
TopoDS::Vertex(myVEdges->Value(1, ipath+1)), TopoDS::Vertex(myVEdges->Value(1, ipath+1)),
Iso->FirstParameter(), Iso->FirstParameter(),
Iso->LastParameter()); Iso->LastParameter());
if (!MkE.IsDone()) { // Erreur de construction !! if (!MkE.IsDone()) { // Error of construction !!
#ifdef DRAW #ifdef DRAW
char name[100]; char name[100];
sprintf(name,"firstvertex_error"); sprintf(name,"firstvertex_error");
@ -1897,7 +1897,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : BuildShell //function : BuildShell
//purpose : Construit une Shell par balayage //purpose : Construct a Shell by sweeping
//====================================================================== //======================================================================
Standard_Boolean BRepFill_Sweep:: Standard_Boolean BRepFill_Sweep::
BuildShell(const BRepFill_TransitionStyle /*Transition*/, BuildShell(const BRepFill_TransitionStyle /*Transition*/,
@ -1920,15 +1920,15 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
(NbPath == myLoc->NbLaw()) && (myLoc->IsG1(0, myTol3d)>= 0); (NbPath == myLoc->NbLaw()) && (myLoc->IsG1(0, myTol3d)>= 0);
Error = 0.; Error = 0.;
// (1) Construction de toutes les surfaces // (1) Construction of all surfaces
// (1.1) Construction des Tables // (1.1) Construction of Tables
TColStd_Array2OfInteger ExchUV(1, NbLaw, 1, NbPath); TColStd_Array2OfInteger ExchUV(1, NbLaw, 1, NbPath);
TColStd_Array2OfInteger UReverse(1, NbLaw, 1, NbPath); TColStd_Array2OfInteger UReverse(1, NbLaw, 1, NbPath);
TColStd_Array2OfInteger Degenerated(1, NbLaw, 1, NbPath); TColStd_Array2OfInteger Degenerated(1, NbLaw, 1, NbPath);
Degenerated.Init(0); Degenerated.Init(0);
// Pas de VReverse pour le moment... // No VReverse for the moment...
TColStd_Array2OfReal TabErr(1, NbLaw , 1, NbPath); TColStd_Array2OfReal TabErr(1, NbLaw , 1, NbPath);
TColGeom_Array2OfSurface TabS(1, NbLaw , 1, NbPath); TColGeom_Array2OfSurface TabS(1, NbLaw , 1, NbPath);
@ -1944,8 +1944,8 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
TColStd_Array1OfReal VError(1, NbLaw+1); TColStd_Array1OfReal VError(1, NbLaw+1);
TColStd_Array1OfReal Vi(1, NbPath+1); TColStd_Array1OfReal Vi(1, NbPath+1);
//Initialisation de la gestion des intervalles parametrique //Initialization of management of parametric intervals
//(Cas des sections evolutive) //(Case of evolutionary sections)
Standard_Real Length, SecDom, SecDeb; Standard_Real Length, SecDom, SecDeb;
myLoc->CurvilinearBounds(myLoc->NbLaw(), SecDom, Length); myLoc->CurvilinearBounds(myLoc->NbLaw(), SecDom, Length);
mySec->Law(1)->GetDomain(SecDeb, SecDom); mySec->Law(1)->GetDomain(SecDeb, SecDom);
@ -1958,7 +1958,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
else else
Vi(1) = SecDeb; Vi(1) = SecDeb;
// Erreur a priori sur les vertex // Error a priori on vertices
if (constSection) { if (constSection) {
for (isec=1; isec<=NbLaw+1; isec++) { for (isec=1; isec<=NbLaw+1; isec++) {
VError(isec) = mySec->VertexTol(isec-1, 0.); VError(isec) = mySec->VertexTol(isec-1, 0.);
@ -1967,13 +1967,13 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
// (1.2) Calcul des surfaces // (1.2) Calculate surfaces
for (ipath=1, IPath=IFirst; ipath <=NbPath; ipath++, IPath++) { for (ipath=1, IPath=IFirst; ipath <=NbPath; ipath++, IPath++) {
GeomFill_Sweep Sweep(myLoc->Law(IPath), KPart); GeomFill_Sweep Sweep(myLoc->Law(IPath), KPart);
Sweep.SetTolerance(myTol3d, myBoundTol, myTol2d, myTolAngular); Sweep.SetTolerance(myTol3d, myBoundTol, myTol2d, myTolAngular);
// Cas des section evolutive, definition de la correspondance parametrique // Case of evolutionary section, definition of parametric correspondence
if (!constSection) { if (!constSection) {
Standard_Real lf, ll, Lf, Ll; Standard_Real lf, ll, Lf, Ll;
myLoc->Law(IPath)->GetDomain(lf, ll); myLoc->Law(IPath)->GetDomain(lf, ll);
@ -2024,13 +2024,13 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
// (2) Construction des Edges // (2) Construction of Edges
Standard_Real UFirst, ULast, VFirst, VLast; Standard_Real UFirst, ULast, VFirst, VLast;
Standard_Boolean exuv, singu, singv; Standard_Boolean exuv, singu, singv;
Handle(Geom_Surface) S; Handle(Geom_Surface) S;
if (! vclose) { if (! vclose) {
// (2.0) recuperation des Edges et vertex prexistant // (2.0) return preexisting Edges and vertices
TopoDS_Edge E; TopoDS_Edge E;
if (! FirstShape.IsNull() && (IFirst==1)) { if (! FirstShape.IsNull() && (IFirst==1)) {
mySec->Init(FirstShape); mySec->Init(FirstShape);
@ -2051,11 +2051,11 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
UpdateVertex(IFirst-1, 1, UpdateVertex(IFirst-1, 1,
TabErr(1, 1), Vi(1), Vertex(1, 1)); TabErr(1, 1), Vi(1), Vertex(1, 1));
} }
else { // Sinon on construit quand meme les vertex else { // Otherwise construct vertices
Standard_Real u, v, aux; Standard_Real u, v, aux;
Standard_Boolean ureverse; Standard_Boolean ureverse;
for (isec=1; isec<=NbLaw+1; isec++) { for (isec=1; isec<=NbLaw+1; isec++) {
// Recuperation des donne // Return data
if (isec >NbLaw) { if (isec >NbLaw) {
S = TabS(NbLaw, 1); S = TabS(NbLaw, 1);
ureverse = UReverse(NbLaw, 1); ureverse = UReverse(NbLaw, 1);
@ -2068,7 +2068,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
S->Bounds(UFirst, ULast, VFirst, VLast); S->Bounds(UFirst, ULast, VFirst, VLast);
// Choix des parametres // Choice of parameters
if (ureverse) { if (ureverse) {
if (exuv) { if (exuv) {
aux = VFirst; VFirst = VLast; VLast = aux; aux = VFirst; VFirst = VLast; VLast = aux;
@ -2092,7 +2092,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
// construction du vertex // construction of vertices
B.MakeVertex(TopoDS::Vertex(Vertex(isec, 1)), B.MakeVertex(TopoDS::Vertex(Vertex(isec, 1)),
S->Value(u,v), S->Value(u,v),
mySec->VertexTol(isec-1,Vi(1))); mySec->VertexTol(isec-1,Vi(1)));
@ -2124,7 +2124,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
Standard_Real u, v, aux; Standard_Real u, v, aux;
Standard_Boolean ureverse; Standard_Boolean ureverse;
for (isec=1; isec<=NbLaw+1; isec++) { for (isec=1; isec<=NbLaw+1; isec++) {
// Recuperation des donne // Return data
if (isec >NbLaw) { if (isec >NbLaw) {
S = TabS(NbLaw, NbPath); S = TabS(NbLaw, NbPath);
ureverse = UReverse(NbLaw, NbPath); ureverse = UReverse(NbLaw, NbPath);
@ -2137,7 +2137,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
S->Bounds(UFirst, ULast, VFirst, VLast); S->Bounds(UFirst, ULast, VFirst, VLast);
// Choix des parametres // Choice of parametres
if (ureverse) { if (ureverse) {
if (exuv) { if (exuv) {
aux = VFirst; VFirst = VLast; VLast = aux; aux = VFirst; VFirst = VLast; VLast = aux;
@ -2161,7 +2161,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
// construction du vertex // construction of vertex
B.MakeVertex(TopoDS::Vertex(Vertex(isec, NbPath+1)), B.MakeVertex(TopoDS::Vertex(Vertex(isec, NbPath+1)),
S->Value(u,v), S->Value(u,v),
mySec->VertexTol(isec-1, Vi(NbPath+1))); mySec->VertexTol(isec-1, Vi(NbPath+1)));
@ -2170,7 +2170,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
// ---------- Creation de Vertex et edge ------------ // ---------- Creation of Vertex and edge ------------
for (ipath=1, IPath=IFirst; ipath<=NbPath; for (ipath=1, IPath=IFirst; ipath<=NbPath;
ipath++, IPath++) { ipath++, IPath++) {
for (isec=1; isec <=NbLaw; isec++) { for (isec=1; isec <=NbLaw; isec++) {
@ -2187,10 +2187,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
// (2.1) Construction des nouveaux vertex // (2.1) Construction of new vertices
if (isec == 1) { if (isec == 1) {
if (ipath == 1 && Vertex(1, 1).IsNull()) { if (ipath == 1 && Vertex(1, 1).IsNull()) {
// Le tout premier // All first
if (constSection) if (constSection)
myLoc->PerformVertex(IPath-1, myLoc->PerformVertex(IPath-1,
TopoDS::Vertex(SecVertex(1)), TopoDS::Vertex(SecVertex(1)),
@ -2202,7 +2202,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
mySec->VertexTol(0,Vi(1)), mySec->VertexTol(0,Vi(1)),
TopoDS::Vertex(Vertex(1, 1))); TopoDS::Vertex(Vertex(1, 1)));
} }
// le premier de la colonne suivante // the first and the next column
if (vclose &&(ipath == NbPath) ) { if (vclose &&(ipath == NbPath) ) {
Vertex(1, ipath+1) = Vertex(1, 1); Vertex(1, ipath+1) = Vertex(1, 1);
} }
@ -2266,7 +2266,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
TopoDS::Vertex(Vertex(isec+1, ipath+1)) ); TopoDS::Vertex(Vertex(isec+1, ipath+1)) );
} }
// Cas Singuliers // Singular cases
singv = MergeVertex(Vertex(isec,ipath+1), Vertex(isec+1,ipath+1)); singv = MergeVertex(Vertex(isec,ipath+1), Vertex(isec+1,ipath+1));
singu = MergeVertex(Vertex(isec+1,ipath), Vertex(isec+1,ipath+1)); singu = MergeVertex(Vertex(isec+1,ipath), Vertex(isec+1,ipath+1));
@ -2278,30 +2278,30 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
if (Degenerated(isec, ipath)) { if (Degenerated(isec, ipath)) {
#if DEB #if DEB
cout << "Sweep : Cas degenere" << endl; cout << "Sweep : Degenerated case" << endl;
#endif #endif
hasdegen = Standard_True; hasdegen = Standard_True;
// Construction particuliere des edge // Particular construction of edges
if (UEdge(isec+1, ipath).IsNull()) { if (UEdge(isec+1, ipath).IsNull()) {
if (singu) { if (singu) {
// Edge degenere // Degenerated edge
UEdge(isec+1, ipath) = NullEdge(Vertex(isec+1,ipath)); UEdge(isec+1, ipath) = NullEdge(Vertex(isec+1,ipath));
} }
else { // Copie de l'edge precedente else { // Copy the previous edge
UEdge(isec+1, ipath) = UEdge(isec, ipath); UEdge(isec+1, ipath) = UEdge(isec, ipath);
} }
} }
if (VEdge(isec, ipath+1).IsNull()) { if (VEdge(isec, ipath+1).IsNull()) {
if (singv) { if (singv) {
// Edge degenere // Degenerated Edge
VEdge(isec, ipath+1) = NullEdge(Vertex(isec,ipath+1)); VEdge(isec, ipath+1) = NullEdge(Vertex(isec,ipath+1));
} }
else { // Copie de l'edge precedente else { // Copy the previous edge
VEdge(isec, ipath+1) = VEdge(isec, ipath); VEdge(isec, ipath+1) = VEdge(isec, ipath);
} }
} }
} }
else { // Construction des edges par les isos else { // Construction of edges by isos
if (exuv) { if (exuv) {
Standard_Real UV; Standard_Real UV;
UV = UFirst; UFirst = VFirst; VFirst = UV; UV = UFirst; UFirst = VFirst; VFirst = UV;
@ -2360,10 +2360,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
S, exuv, VLast); S, exuv, VLast);
} }
}//Fin de contruction des edges }// End of construction of edges
} }
// (3) Construction des Faces // (3) Construction of Faces
TopoDS_Face face; TopoDS_Face face;
#ifdef DRAW #ifdef DRAW
@ -2413,10 +2413,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
// (4) Historique et Continuity // (4) History and Continuity
if (hasdegen) { if (hasdegen) {
//(4.1) // Cas degenere => Marteau Pilon //(4.1) // Degenerated case => Sledgehammer
TopoDS_Compound Comp; TopoDS_Compound Comp;
B.MakeCompound(Comp); B.MakeCompound(Comp);
for (isec=1; isec <= NbLaw+1; isec++) for (isec=1; isec <= NbLaw+1; isec++)
@ -2430,7 +2430,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
BRepLib::EncodeRegularity(Comp, myTolAngular); BRepLib::EncodeRegularity(Comp, myTolAngular);
} }
else { else {
//(4.2) // Cas generale => Pince a epiler //(4.2) // General case => Tweezers
Standard_Boolean isG1; Standard_Boolean isG1;
TopoDS_Face FF; TopoDS_Face FF;
TopoDS_Edge E; TopoDS_Edge E;
@ -2452,7 +2452,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
Standard_Integer nbpath = NbPath; Standard_Integer nbpath = NbPath;
if (vclose) nbpath++; //Un test G1 en plus if (vclose) nbpath++; //Another test G1
for (ipath=1, IPath=IFirst; ipath<= NbPath+1; ipath++, IPath++) { for (ipath=1, IPath=IFirst; ipath<= NbPath+1; ipath++, IPath++) {
if ((ipath > 1) && (ipath <=nbpath)) if ((ipath > 1) && (ipath <=nbpath))
isG1 = (myLoc->IsG1(IPath-1, myTol3d, myTolAngular) >= 0); isG1 = (myLoc->IsG1(IPath-1, myTol3d, myTolAngular) >= 0);
@ -2475,7 +2475,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : Build //function : Build
//purpose : Construit le resultat d'un balayage //purpose : Construt the result of sweeping
//====================================================================== //======================================================================
void BRepFill_Sweep::Build(const BRepFill_TransitionStyle Transition, void BRepFill_Sweep::Build(const BRepFill_TransitionStyle Transition,
const GeomFill_ApproxStyle Approx, const GeomFill_ApproxStyle Approx,
@ -2507,20 +2507,20 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
Handle(TColStd_HArray1OfInteger) Trous; Handle(TColStd_HArray1OfInteger) Trous;
if (NbTrous>0) { // Combien de sous parties ? if (NbTrous>0) { // How many sub-parts ?
Trous = new (TColStd_HArray1OfInteger) (1, NbTrous); Trous = new (TColStd_HArray1OfInteger) (1, NbTrous);
myLoc->Holes(Trous->ChangeArray1()); myLoc->Holes(Trous->ChangeArray1());
NbPart += NbTrous; NbPart += NbTrous;
if (Trous->Value(NbTrous) == NbPath+1) NbPart--; if (Trous->Value(NbTrous) == NbPath+1) NbPart--;
} }
if (NbPart == 1) { // On le fait en un coup if (NbPart == 1) { // This is done at once
Standard_Real Extend = 0.0; Standard_Real Extend = 0.0;
if (NbTrous==1) Extend = EvalExtrapol(1, Transition); if (NbTrous==1) Extend = EvalExtrapol(1, Transition);
isDone = BuildShell(Transition, isDone = BuildShell(Transition,
1, NbPath+1, 1, NbPath+1,
Extend, Extend); Extend, Extend);
} }
else { // On le fait bout par bout else { // This is done piece by piece
Standard_Integer IFirst = 1, ILast; Standard_Integer IFirst = 1, ILast;
for (ii=1, isDone=Standard_True; for (ii=1, isDone=Standard_True;
ii<=NbPart && isDone; ii++) { ii<=NbPart && isDone; ii++) {
@ -2539,7 +2539,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
Translate(myVEdges, IFirst, Bounds, 1); Translate(myVEdges, IFirst, Bounds, 1);
} }
} }
// Gestion des terminaisons bouclantes // Management of looping ends
if ( (NbTrous>0) && (myLoc->IsClosed()) && if ( (NbTrous>0) && (myLoc->IsClosed()) &&
(Trous->Value(NbTrous) == NbPath+1) ) { (Trous->Value(NbTrous) == NbPath+1) ) {
Translate(myVEdges, NbPath+1, Bounds, 1); Translate(myVEdges, NbPath+1, Bounds, 1);
@ -2547,7 +2547,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
PerformCorner(1, Transition, Bounds); PerformCorner(1, Transition, Bounds);
} }
// Construction de la shell // Construction of the shell
TopoDS_Shell shell; TopoDS_Shell shell;
B.MakeShell(shell); B.MakeShell(shell);
for (ipath=1; ipath<=NbPath; ipath++) for (ipath=1; ipath<=NbPath; ipath++)
@ -2634,9 +2634,9 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
// Est ce Ferme ? // Is it Closed ?
if (myLoc->IsClosed() && mySec->IsUClosed()) { if (myLoc->IsClosed() && mySec->IsUClosed()) {
//On verifie //Check
Standard_Boolean closed = Standard_True; Standard_Boolean closed = Standard_True;
Standard_Integer iedge; Standard_Integer iedge;
TopTools_IndexedDataMapOfShapeListOfShape EFmap; TopTools_IndexedDataMapOfShapeListOfShape EFmap;
@ -2684,7 +2684,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : SubShape //function : SubShape
//purpose : Les faces obtenues par balayage //purpose : Faces obtained by sweeping
//======================================================================= //=======================================================================
Handle(TopTools_HArray2OfShape) BRepFill_Sweep::SubShape() const Handle(TopTools_HArray2OfShape) BRepFill_Sweep::SubShape() const
{ {
@ -2693,7 +2693,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : InterFaces //function : InterFaces
//purpose : les Edges obtenues par balayage //purpose : Edges obtained by sweeping
//======================================================================= //=======================================================================
Handle(TopTools_HArray2OfShape) BRepFill_Sweep::InterFaces() const Handle(TopTools_HArray2OfShape) BRepFill_Sweep::InterFaces() const
{ {
@ -2702,7 +2702,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : Sections //function : Sections
//purpose : Les Edges ou Face (ou compound des 2) Transition entre 2 balayages. //purpose : Edges or Face (or compound of 2) Transition between 2 sweepings
//======================================================================= //=======================================================================
Handle(TopTools_HArray2OfShape) BRepFill_Sweep::Sections() const Handle(TopTools_HArray2OfShape) BRepFill_Sweep::Sections() const
{ {
@ -2711,14 +2711,14 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
//======================================================================= //=======================================================================
//function : PerformCorner //function : PerformCorner
//purpose : Trim et/ou bouche un coin //purpose : Trim and/or loop a corner
//====================================================================== //======================================================================
void BRepFill_Sweep::PerformCorner(const Standard_Integer Index, void BRepFill_Sweep::PerformCorner(const Standard_Integer Index,
const BRepFill_TransitionStyle Transition, const BRepFill_TransitionStyle Transition,
const Handle(TopTools_HArray2OfShape)& Bounds) const Handle(TopTools_HArray2OfShape)& Bounds)
{ {
if (Transition == BRepFill_Modified) return; // On ne fait rien. if (Transition == BRepFill_Modified) return; // Do nothing.
BRepFill_TransitionStyle TheTransition = Transition; BRepFill_TransitionStyle TheTransition = Transition;
Standard_Boolean isTangent=Standard_False; Standard_Boolean isTangent=Standard_False;
@ -2740,7 +2740,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
I2 = 1; I2 = 1;
} }
// On Construit un axe supporte par la bissectrice // Construct an axis supported by the bissectrice
myLoc->Law(I1)->GetDomain(F, L); myLoc->Law(I1)->GetDomain(F, L);
myLoc->Law(I1)->GetCurve()->D1(L, P1, T1); myLoc->Law(I1)->GetCurve()->D1(L, P1, T1);
T1.Normalize(); T1.Normalize();
@ -2762,7 +2762,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
if (t1.Angle(t2) < myAngMin) { if (t1.Angle(t2) < myAngMin) {
#if DEB #if DEB
cout << "BRepFill_Sweep::PerformCorner : Ce n'est pas un coin !" << endl; cout << "BRepFill_Sweep::PerformCorner : This is not a corner !" << endl;
#endif #endif
return; return;
} }
@ -2774,15 +2774,15 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
TheTransition = BRepFill_Round; TheTransition = BRepFill_Round;
} }
Tang = T1 + T2; //Direction moyenne Tang = T1 + T2; //Average direction
gp_Dir NormalOfBisPlane = Tang; gp_Dir NormalOfBisPlane = Tang;
if (isTangent) { if (isTangent) {
Sortant -= Tang.Dot(Tang)*Tang; Sortant -= Tang.Dot(Tang)*Tang;
} }
else { else {
Sortant = T2-T1; //Direction rentrente Sortant = T2-T1; //Direction input
Sortant *= -1; // " " sortante Sortant *= -1; // " " output
Tang -= (Tang.Dot(T2))*T2; Tang -= (Tang.Dot(T2))*T2;
} }
@ -2793,7 +2793,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
gp_Ax2 Axe (P1, N, Dx); gp_Ax2 Axe (P1, N, Dx);
gp_Ax2 AxeOfBisPlane( P1, NormalOfBisPlane ); gp_Ax2 AxeOfBisPlane( P1, NormalOfBisPlane );
// On construit les 2 Shell a intersecter // Construct 2 intersecting Shells
Handle (TopTools_HArray2OfShape) UEdges = Handle (TopTools_HArray2OfShape) UEdges =
new TopTools_HArray2OfShape( 1, mySec->NbLaw()+1, 1, myLoc->NbLaw() ); new TopTools_HArray2OfShape( 1, mySec->NbLaw()+1, 1, myLoc->NbLaw() );
UEdges->ChangeArray2() = myUEdges->Array2(); UEdges->ChangeArray2() = myUEdges->Array2();
@ -2855,9 +2855,9 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
else if ((TheTransition == BRepFill_Right) || else if ((TheTransition == BRepFill_Right) ||
aTrim.HasSection() ) { aTrim.HasSection() ) {
#if DEB #if DEB
cout << "Echec de TrimCorner" << endl; cout << "Fail of TrimCorner" << endl;
#endif #endif
return; // On ne touche a rien return; // Nothing is touched
} }
if (mySec->IsUClosed()) if (mySec->IsUClosed())
@ -2867,7 +2867,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
if (TheTransition == BRepFill_Round) { if (TheTransition == BRepFill_Round) {
// Remplissage // Filling
TopTools_ListOfShape list1, list2; TopTools_ListOfShape list1, list2;
TopoDS_Edge Bord1, Bord2, BordFirst; TopoDS_Edge Bord1, Bord2, BordFirst;
BordFirst.Nullify(); BordFirst.Nullify();
@ -2883,7 +2883,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
TopTools_ListIteratorOfListOfShape It2(list2); TopTools_ListIteratorOfListOfShape It2(list2);
Standard_Boolean B; Standard_Boolean B;
for (; It1.More(); It1.Next(), It2.Next()) { for (; It1.More(); It1.Next(), It2.Next()) {
if (HasFilling) { // Choix des contraintes transversale if (HasFilling) { // Transversal choice of constraints
TopoDS_Vertex VF, VL, VC; TopoDS_Vertex VF, VL, VC;
TopoDS_Edge E = TopoDS::Edge(It1.Value()); TopoDS_Edge E = TopoDS::Edge(It1.Value());
TopoDS_Edge E1, E2; TopoDS_Edge E1, E2;
@ -2909,7 +2909,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
Bord2 = E2; Bord2 = E2;
} }
// Remplissage // Filling
B = Filling(It1.Value(), myFaces->Value(ii, I1), B = Filling(It1.Value(), myFaces->Value(ii, I1),
It2.Value(), myFaces->Value(ii, I2), It2.Value(), myFaces->Value(ii, I2),
myVEdgesModified, myTol3d, Axe, T1, Bord1, Bord2, FF); myVEdgesModified, myTol3d, Axe, T1, Bord1, Bord2, FF);
@ -2923,7 +2923,7 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
} }
} }
#if DEB #if DEB
else cout << "PerformCorner : Disymetrie de bord libre" << endl; else cout << "PerformCorner : Unsymmetry of free border" << endl;
#endif #endif
} }
} }
@ -2979,8 +2979,8 @@ Standard_Real BRepFill_Sweep::
Standard_Real alpha = T1.Angle(T2); Standard_Real alpha = T1.Angle(T2);
if ((alpha > myAngMax) || (alpha < myAngMin)) { if ((alpha > myAngMax) || (alpha < myAngMin)) {
//Angle trop grand => Pas de raccord "droit" //Angle too great => No "straight" connection
//Angle trop petit => Pas de raccord //Angle too small => No connection
return Extrap; // = 0.0 return Extrap; // = 0.0
} }
@ -3014,7 +3014,7 @@ Standard_Real BRepFill_Sweep::
//======================================================================= //=======================================================================
//function : MergeVertex //function : MergeVertex
//purpose : Fait V2 = V1 si V2 est trop proche de V1 //purpose : Make V2 = V1 if V2 is too close to V1
//====================================================================== //======================================================================
Standard_Boolean BRepFill_Sweep::MergeVertex(const TopoDS_Shape& V1, Standard_Boolean BRepFill_Sweep::MergeVertex(const TopoDS_Shape& V1,
TopoDS_Shape& V2) const TopoDS_Shape& V2) const
@ -3038,7 +3038,7 @@ Standard_Boolean BRepFill_Sweep::MergeVertex(const TopoDS_Shape& V1,
//======================================================================= //=======================================================================
//function : UpdateVertex //function : UpdateVertex
//purpose : Update la Tolerance des Vertexs en Fonction des Lois. //purpose : Update the Tolerance of Vertices depending on Laws.
//====================================================================== //======================================================================
void BRepFill_Sweep::UpdateVertex(const Standard_Integer ipath, void BRepFill_Sweep::UpdateVertex(const Standard_Integer ipath,
const Standard_Integer isec, const Standard_Integer isec,

View File

@ -83,7 +83,7 @@ myBisec(Bisec)
isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint1 = (S1->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint)); isPoint2 = (S2->DynamicType() == STANDARD_TYPE(Geom2d_CartesianPoint));
// recuperation des geometries des shapes. // return geometries of shapes.
// Standard_Real f,l; // Standard_Real f,l;
if (isPoint1) { if (isPoint1) {
myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d(); myP1 = Handle(Geom2d_Point)::DownCast(S1)->Pnt2d();
@ -112,7 +112,7 @@ myBisec(Bisec)
} }
#endif #endif
} }
// recuperer l expression simple de la bisectrice // return the simple expression of the bissectrice
Handle(Geom2d_Curve) Bis; Handle(Geom2d_Curve) Bis;
SimpleExpression(myBisec, Bis); SimpleExpression(myBisec, Bis);
myBis = Geom2dAdaptor_Curve(Bis); myBis = Geom2dAdaptor_Curve(Bis);
@ -127,7 +127,7 @@ myBisec(Bisec)
//======================================================================= //=======================================================================
//function : Bubble //function : Bubble
//purpose : Ordonne la sequence de point en x croissant. //purpose : Order the sequence of points by increasing x.
//======================================================================= //=======================================================================
static void Bubble(TColgp_SequenceOfPnt& Seq) static void Bubble(TColgp_SequenceOfPnt& Seq)
@ -149,7 +149,7 @@ static void Bubble(TColgp_SequenceOfPnt& Seq)
//======================================================================= //=======================================================================
//function : EvalParameters (lbr le 8 juillet, je duplique pour modifier) //function : EvalParameters
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -218,7 +218,7 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
} }
} }
// Ordonne la sequence en param croissant sur la bissectrice. // Order the sequence by growing parameter on the bissectrice.
Bubble( Params); Bubble( Params);
} }
@ -282,7 +282,7 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis,
} }
} }
// Ordonne la sequence en param croissant sur la bissectrice. // Order the sequence by parameter growing on the bissectrice.
Bubble( Params); Bubble( Params);
} }
@ -298,7 +298,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
{ {
Params.Clear(); Params.Clear();
// recuperer les courbes associees aux edges. // return curves associated to edges.
TopLoc_Location L; TopLoc_Location L;
Standard_Real f,l; Standard_Real f,l;
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
@ -333,7 +333,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
} }
#endif #endif
// Calcul intersection // Calculate intersection
TColgp_SequenceOfPnt Points2; TColgp_SequenceOfPnt Points2;
gp_Pnt PSeq; gp_Pnt PSeq;
@ -359,7 +359,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
(Points2.Length() == 0 && Params.Length() == 0) ) ) { (Points2.Length() == 0 && Params.Length() == 0) ) ) {
#ifdef DEB #ifdef DEB
cout << "BRepFill_TrimEdgeTool: incoherent intersection. On essaie avec une tol plus grande" << endl; cout << "BRepFill_TrimEdgeTool: incoherent intersection. Try with a greater tolerance" << endl;
#endif #endif
Params.Clear(); Params.Clear();
@ -421,10 +421,10 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
} }
} }
// petite manip destinee a eliminer les intersections incoherentes: // small manipulation to remove incorrect intersections:
// on ne renvoie que les intersections communes ( meme parametre sur // return only common intersections (same parameter
// la bissectrice.). // on the bissectrice.).
// La tolerance pourra eventuellement etre reglee. // The tolerance can be eventually changed.
gp_Pnt P1,P2; gp_Pnt P1,P2;
Standard_Real Tol = 4 * 100 * Precision::PConfusion(); Standard_Real Tol = 4 * 100 * Precision::PConfusion();
@ -449,11 +449,11 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
if ( P1xP2x > Tol ) { if ( P1xP2x > Tol ) {
#ifdef DEB #ifdef DEB
cout << "BRepFill_TrimEdgeTool: Pas le meme parametre sur la bissectrice" << endl; cout << "BRepFill_TrimEdgeTool: no same parameter on the bissectrice" << endl;
#endif #endif
if(P1xP2x>TolInit) { if(P1xP2x>TolInit) {
#ifdef DEB #ifdef DEB
cout << "BRepFill_TrimEdgeTool: On continue quand meme" << endl; cout << "BRepFill_TrimEdgeTool: Continue somehow" << endl;
#endif #endif
i++; i++;
} }
@ -482,9 +482,9 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
//======================================================================= //=======================================================================
//function : AddOrConfuse //function : AddOrConfuse
//purpose : le premier ou le dernier point de la bissectrice est sur la //purpose : the first or the last point of the bissectrice is on the
// parallele si on ne l a pas trouve dans les intersections on // parallel if it was not found in the intersections,
// le projette sur les paralleles et on l ajoute dans les params // it is projected on parallel lines and added in the parameters
//======================================================================= //=======================================================================
void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start, void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
@ -497,7 +497,7 @@ const
gp_Pnt2d PBis; gp_Pnt2d PBis;
Standard_Real Tol = 10*Precision::Confusion(); Standard_Real Tol = 10*Precision::Confusion();
// recuperer les courbes associees aux edges. // return curves associated to edges.
TopLoc_Location L; TopLoc_Location L;
Standard_Real f,l; Standard_Real f,l;
Handle(Geom_Surface) Surf; Handle(Geom_Surface) Surf;
@ -510,7 +510,7 @@ const
if (Start) PBis = myBis.Value(myBis.FirstParameter()); if (Start) PBis = myBis.Value(myBis.FirstParameter());
else PBis = myBis.Value(myBis.LastParameter ()); else PBis = myBis.Value(myBis.LastParameter ());
// Test si le bout de la bissectrice est dans l ensemble des points d intersection. // Test if the end of the bissectrice is in the set of intersection points.
if (!Params.IsEmpty()) { if (!Params.IsEmpty()) {
gp_Pnt2d P; gp_Pnt2d P;
if (Start) P = AC1.Value(Params.First().Y()); if (Start) P = AC1.Value(Params.First().Y());
@ -520,10 +520,10 @@ const
if (ToProj) { if (ToProj) {
#ifdef DEB #ifdef DEB
cout << " projection extremite bissectrice sur parallele."<<endl; cout << " project extremity bissectrice on parallel."<<endl;
#endif #endif
// Projection du point sur les paralleles et ajout dans Params // Project point on parallels and add in Params
Standard_Real f2,l2; Standard_Real f2,l2;
Handle(Geom2d_Curve) C2; Handle(Geom2d_Curve) C2;
@ -534,19 +534,19 @@ const
if (Projector1.NbPoints() == 0) { if (Projector1.NbPoints() == 0) {
#ifdef DEB #ifdef DEB
cout << "Echec projection dans BRepFill_TrimEdgeTool::AddOrConfuse"<<endl; cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
#endif #endif
return; return;
} }
if (!Projector1.NearestPoint().IsEqual(PBis,Tol)) { if (!Projector1.NearestPoint().IsEqual(PBis,Tol)) {
#ifdef DEB #ifdef DEB
cout <<" Mauvaisesolution dans BRepFill_TrimEdgeTool::AddOrConfuse"<<endl; cout <<"Incorrect solution in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
#endif #endif
return; return;
} }
if (Projector2.NbPoints() == 0) { if (Projector2.NbPoints() == 0) {
#ifdef DEB #ifdef DEB
cout << "Echec projection dans BRepFill_TrimEdgeTool::AddOrConfuse"<<endl; cout << "Failed projection in BRepFill_TrimEdgeTool::AddOrConfuse"<<endl;
#endif #endif
return; return;
} }

View File

@ -61,12 +61,12 @@ static Standard_Integer NBCALL = 1;
//======================================================================= //=======================================================================
//function : BRepFill_TrimSurfaceTool //function : BRepFill_TrimSurfaceTool
//purpose : Initialisation avec les deux face voisines //purpose : Initialisation with two neighbor faces
// Edge1 et Edge2 sont les edges paralleles correspondant // Edge1 and Edge2 are parallel edges corresponding
// a une iso minimum sur F1 et F2 respectivement. // to minimum iso on F1 and F2 respectively.
// ie Edge1 est Umin ou VMin sur F1. // ie Edge1 is Umin or VMin on F1.
// Inv1 et Inv2 indique si Edge1 et Edge2 sont des // Inv1 and Inv2 show if Edge1 and Edge2 are
// parallleles retournees. // returned parallel.
//======================================================================= //=======================================================================
BRepFill_TrimSurfaceTool::BRepFill_TrimSurfaceTool BRepFill_TrimSurfaceTool::BRepFill_TrimSurfaceTool
@ -115,7 +115,7 @@ myBis (Bis)
//======================================================================= //=======================================================================
//function : Bubble //function : Bubble
//purpose : Ordonne la sequence de point en x croissant. //purpose : Order the sequence of points by increasing x.
//======================================================================= //=======================================================================
static void Bubble(TColgp_SequenceOfPnt& Seq) static void Bubble(TColgp_SequenceOfPnt& Seq)
@ -183,7 +183,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
TColgp_SequenceOfPnt& Seq ) TColgp_SequenceOfPnt& Seq )
{ {
Standard_Boolean Degener = BRep_Tool::Degenerated(Edge); Standard_Boolean Degener = BRep_Tool::Degenerated(Edge);
// recuperer les courbes 3d associees aux edges. // return curves 3d associated to edges.
TopLoc_Location L; TopLoc_Location L;
Standard_Real f,l; Standard_Real f,l;
@ -205,7 +205,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
Handle(Geom_Curve) C = BRep_Tool::Curve(Edge,L,f,l); Handle(Geom_Curve) C = BRep_Tool::Curve(Edge,L,f,l);
CT = new Geom_TrimmedCurve(C,f,l); CT = new Geom_TrimmedCurve(C,f,l);
CT->Transform(L.Transformation()); CT->Transform(L.Transformation());
// projection de ces courbes 3d dans le plan xOy // projection of 3d curves in the plane xOy
Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane); Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane);
Geom2dAdaptor_Curve AC(C2d); Geom2dAdaptor_Curve AC(C2d);
@ -268,7 +268,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
if (NbSegments > 0) { if (NbSegments > 0) {
#ifdef DEB #ifdef DEB
cout << " IntersectWith : " << NbSegments cout << " IntersectWith : " << NbSegments
<< " Segments d`intersection" << endl; << " Segments of intersection" << endl;
#endif #endif
IntRes2d_IntersectionSegment Seg; IntRes2d_IntersectionSegment Seg;
for ( Standard_Integer i = 1; i <= NbSegments; i++) { for ( Standard_Integer i = 1; i <= NbSegments; i++) {
@ -283,7 +283,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
Seq.Append(P); Seq.Append(P);
} }
} }
// Ordonne la sequence en param croissant sur la bissectrice. // Order the sequence by increasing parameter on the bissectrice.
Bubble( Seq); Bubble( Seq);
// modified by NIZHNY-EAP Fri Dec 24 18:47:24 1999 ___BEGIN___ // modified by NIZHNY-EAP Fri Dec 24 18:47:24 1999 ___BEGIN___
@ -301,8 +301,8 @@ static void EvalParameters(const TopoDS_Edge& Edge,
// modified by NIZHNY-EAP Fri Dec 24 18:47:28 1999 ___END___ // modified by NIZHNY-EAP Fri Dec 24 18:47:28 1999 ___END___
} }
else { else {
// l`edge est degenere : on recupere le point et on cherche s`il est sur // the edge is degenerated : the point and it is found if it is
// la bissectrice. // on the bissectrice.
gp_Pnt P3d = BRep_Tool::Pnt( TopExp::FirstVertex(Edge)); gp_Pnt P3d = BRep_Tool::Pnt( TopExp::FirstVertex(Edge));
gp_Pnt2d P2d( P3d.X(), P3d.Y()); gp_Pnt2d P2d( P3d.X(), P3d.Y());
@ -325,7 +325,7 @@ static void EvalParameters(const TopoDS_Edge& Edge,
if ( PBis.Distance(P2d) > Tol) return; if ( PBis.Distance(P2d) > Tol) return;
} }
// eval parametre intersection. // evaluate parameter intersection.
Handle(Geom_Surface) GS = BRep_Tool::Surface(Face); Handle(Geom_Surface) GS = BRep_Tool::Surface(Face);
GeomAdaptor_Surface GAS(GS); GeomAdaptor_Surface GAS(GS);
@ -338,8 +338,8 @@ static void EvalParameters(const TopoDS_Edge& Edge,
Axis = GAS.Sphere().Position(); break; Axis = GAS.Sphere().Position(); break;
case GeomAbs_Cone: { case GeomAbs_Cone: {
//---------------------------------------------------------- //----------------------------------------------------------
// si myFace1 n est pas du meme cote de l apex que le point // if myFace1 is not at the same side of the apex as the point
// de parametre 0 0 sur le cone => phase = PI. // of parameter 0 0 on the cone => phase = PI.
//---------------------------------------------------------- //----------------------------------------------------------
Axis = GAS.Cone().Position(); Axis = GAS.Cone().Position();
Phase = EvalPhase(Edge,Face,GAS,Axis); Phase = EvalPhase(Edge,Face,GAS,Axis);
@ -351,8 +351,8 @@ static void EvalParameters(const TopoDS_Edge& Edge,
Axis = GAS.Cylinder().Position(); break; Axis = GAS.Cylinder().Position(); break;
case GeomAbs_SurfaceOfRevolution: { case GeomAbs_SurfaceOfRevolution: {
//---------------------------------------------------------- //----------------------------------------------------------
// si myFace1 n est pas du meme cote de l apex que le point // if myFace1 is not at the same side of the apex as the point
// de parametre 0 0 sur le cone => phase = PI. // of parameter 0 0 on the cone => phase = PI.
//---------------------------------------------------------- //----------------------------------------------------------
Handle(Geom_SurfaceOfRevolution) GSRev = Handle(Geom_SurfaceOfRevolution) GSRev =
Handle(Geom_SurfaceOfRevolution)::DownCast(GS); Handle(Geom_SurfaceOfRevolution)::DownCast(GS);
@ -455,11 +455,11 @@ Standard_Real BRepFill_TrimSurfaceTool::ProjOn(const gp_Pnt2d& Point,
Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C1,f,l); Handle(Geom_TrimmedCurve) CT = new Geom_TrimmedCurve(C1,f,l);
CT->Transform(L.Transformation()); CT->Transform(L.Transformation());
// projection de ces courbes 3d dans le plan xOy // projection of curves 3d in the plane xOy
Handle(Geom_Plane) Plane = new Geom_Plane(0,0,1,0); Handle(Geom_Plane) Plane = new Geom_Plane(0,0,1,0);
Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane); Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(CT,Plane);
// eval the projection of the point on the curve. // evaluate the projection of the point on the curve.
Geom2dAPI_ProjectPointOnCurve Projector(Point, C2d); Geom2dAPI_ProjectPointOnCurve Projector(Point, C2d);
#ifdef DEB #ifdef DEB
Standard_Real Dist = Standard_Real Dist =
@ -468,7 +468,7 @@ Standard_Real BRepFill_TrimSurfaceTool::ProjOn(const gp_Pnt2d& Point,
#ifdef DEB #ifdef DEB
if ( Dist > Precision::Confusion() ) { if ( Dist > Precision::Confusion() ) {
cout << " *** WARNING TrimSurfaceTool: *** " << endl; cout << " *** WARNING TrimSurfaceTool: *** " << endl;
cout << " --> le point n'est pas sur l'edge" <<endl; cout << " --> the point is not on the edge" <<endl;
cout << " distance = " << Dist << endl; cout << " distance = " << Dist << endl;
} }
#endif #endif

View File

@ -90,7 +90,7 @@ void BRepIntCurveSurface_Inter::Find() {
Standard_Real U = intcs.Point(currentindex).U(); Standard_Real U = intcs.Point(currentindex).U();
Standard_Real V = intcs.Point(currentindex).V(); Standard_Real V = intcs.Point(currentindex).V();
//------------------------------------------------------- //-------------------------------------------------------
//-- On Cherche a recadrer le point U,V ds la face UV //-- Try to reframe point U,V in the face UV
//-- //--
if(PeriodU) { if(PeriodU) {
while(U>UMin) while(U>UMin)
@ -102,9 +102,9 @@ void BRepIntCurveSurface_Inter::Find() {
} }
// Standard_Real UInit = U; // Standard_Real UInit = U;
Standard_Real VInit = V; Standard_Real VInit = V;
do { //-- Boucle Sur U do { //-- Loop on U
V = VInit; V = VInit;
do { //-- Boucle sur V do { //-- Loop on V
gp_Pnt2d Puv(U,V); gp_Pnt2d Puv(U,V);
//--- //---
//-- classifier.Perform(TopoDS::Face(explorer.Current()),Puv,tolerance); //-- classifier.Perform(TopoDS::Face(explorer.Current()),Puv,tolerance);
@ -135,7 +135,7 @@ void BRepIntCurveSurface_Inter::Find() {
brepadaptsurf.Initialize(face,Standard_True); brepadaptsurf.Initialize(face,Standard_True);
//---------------------------------------------- //----------------------------------------------
//-- Mise a jour des variables PeriodU,PeriodV //-- Update variables PeriodU,PeriodV
//-- //--
SurfForFastClass->ChangeSurface().Initialize(face); //-- MODIF SurfForFastClass->ChangeSurface().Initialize(face); //-- MODIF

View File

@ -3,7 +3,7 @@
// Author: Remi LEQUETTE // Author: Remi LEQUETTE
// <rle@zerox> // <rle@zerox>
// History: pmn 26/09/97 Ajout des parametres d'approx dans BuildCurve3d // History: pmn 26/09/97 Add parameters of approximation in BuildCurve3d
// Modified by skv - Thu Jun 3 12:39:19 2004 OCC5898 // Modified by skv - Thu Jun 3 12:39:19 2004 OCC5898
#include <BRepLib.ixx> #include <BRepLib.ixx>
@ -71,10 +71,6 @@
#include <Approx_CurvilinearParameter.hxx> #include <Approx_CurvilinearParameter.hxx>
#include <Geom_BSplineSurface.hxx> #include <Geom_BSplineSurface.hxx>
//
// comme on ne pas patcher en cdl GEOMLITE temporairement les GeomLib_ migrent
// dans BRepLib ...
//
static Standard_Real thePrecision = Precision::Confusion(); static Standard_Real thePrecision = Precision::Confusion();
static Handle(Geom_Plane) thePlane; static Handle(Geom_Plane) thePlane;
@ -361,7 +357,7 @@ Standard_Boolean BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge,
B.UpdateEdge(AnEdge,C3d,LocalLoc,0.0e0); B.UpdateEdge(AnEdge,C3d,LocalLoc,0.0e0);
BRep_Tool::Range(AnEdge, S, LC, First, Last); BRep_Tool::Range(AnEdge, S, LC, First, Last);
B.Range(AnEdge, First, Last); //Ne pas oublier le range du 3d.(PRO6412) B.Range(AnEdge, First, Last); //Do not forget 3D range.(PRO6412)
TopoDS_Edge E = AnEdge ; TopoDS_Edge E = AnEdge ;
E.Closed(is_closed) ; E.Closed(is_closed) ;
@ -834,12 +830,12 @@ void BRepLib::SameParameter(const TopoDS_Shape& S,
BRepLib::UpdateTolerances(S); BRepLib::UpdateTolerances(S);
} }
//======================================================================= //================================================================
//function : SameParameter //function : SameParameter
//WARNING : Nouvelle spec DUB LBO 9/9/97. //WARNING : New spec DUB LBO 9/9/97.
// On recode dans l arete la meilleure tolerance trouvee, // Recode in the edge the best tolerance found,
// pour les vertex extremites il faudra trouver autre chose. // for vertex extremities it is required to find something else
//======================================================================= //================================================================
static Standard_Boolean EvalTol(const Handle(Geom2d_Curve)& pc, static Standard_Boolean EvalTol(const Handle(Geom2d_Curve)& pc,
const Handle(Geom_Surface)& s, const Handle(Geom_Surface)& s,
const GeomAdaptor_Curve& gac, const GeomAdaptor_Curve& gac,
@ -1287,13 +1283,13 @@ void BRepLib::SameParameter(const TopoDS_Edge& AnEdge,
B.Range(AnEdge,f3d,l3d); B.Range(AnEdge,f3d,l3d);
B.SameRange(AnEdge,Standard_True); B.SameRange(AnEdge,Standard_True);
if ( IsSameP) { if ( IsSameP) {
// On diminue eventuellement la tolerance de l arete, puisque // Reduce eventually the tolerance of the edge, as
// l on a traite toutes ses representations ( Sauf celles associees // all its representations are processed (except for some associated
// a des plans et non stockees dans l'arete !) // to planes and not stored in the edge !)
// Il n'en va pas de meme des Vertex que l on ne peut que grossir // The same cannot be done with vertices that cannot be enlarged
// ou laisser tels quels. // or left as is.
if (YaPCu) { if (YaPCu) {
// On evite de mettre des tol trop petites. // Avoid setting too small tolerances.
maxdist = Max(maxdist,Precision::Confusion()); maxdist = Max(maxdist,Precision::Confusion());
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
TopExp::Vertices(AnEdge,V1,V2); TopExp::Vertices(AnEdge,V1,V2);
@ -1316,12 +1312,12 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
const Standard_Boolean verifyTolerance) const Standard_Boolean verifyTolerance)
{ {
// On harmonise les tolerance // Harmonize tolerances
// avec la regle Tolerance(VERTEX)>=Tolerance(EDGE)>=Tolerance(FACE) // with rule Tolerance(VERTEX)>=Tolerance(EDGE)>=Tolerance(FACE)
BRep_Builder B; BRep_Builder B;
Standard_Real tol=0; Standard_Real tol=0;
if (verifyTolerance) { if (verifyTolerance) {
// On force la tolerance a sa valeur minimale // Set tolerance to its minimum value
Handle(Geom_Surface) S; Handle(Geom_Surface) S;
TopLoc_Location l; TopLoc_Location l;
TopExp_Explorer ex; TopExp_Explorer ex;
@ -1363,7 +1359,7 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
if (aYmin>dMax) dMax=aYmin; if (aYmin>dMax) dMax=aYmin;
if (aZmin>dMax) dMax=aZmin; if (aZmin>dMax) dMax=aZmin;
tol=tol*dMax; tol=tol*dMax;
// On ne traite pas les tolerance > 1. // Do not process tolerances > 1.
if (tol>1.) tol=0.99; if (tol>1.) tol=0.99;
} }
const Handle(BRep_TFace)& Tf = *((Handle(BRep_TFace)*)&curf.TShape()); const Handle(BRep_TFace)& Tf = *((Handle(BRep_TFace)*)&curf.TShape());
@ -1372,7 +1368,7 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
} }
} }
//On traite les edges //Process edges
TopTools_IndexedDataMapOfShapeListOfShape parents; TopTools_IndexedDataMapOfShapeListOfShape parents;
TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, parents); TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, parents);
TopTools_ListIteratorOfListOfShape lConx; TopTools_ListIteratorOfListOfShape lConx;
@ -1382,12 +1378,12 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) { for (lConx.Initialize(parents(iCur)); lConx.More(); lConx.Next()) {
tol=Max(tol, BRep_Tool::Tolerance(TopoDS::Face(lConx.Value()))); tol=Max(tol, BRep_Tool::Tolerance(TopoDS::Face(lConx.Value())));
} }
// Update ne peut que augmenter la tolerance, donc si l'edge a // Update can only increase tolerance, so if the edge has a greater
// une tolerance + grande que ses faces on y touche pas // tolerance than its faces it is not concerned
B.UpdateEdge(TopoDS::Edge(parents.FindKey(iCur)), tol); B.UpdateEdge(TopoDS::Edge(parents.FindKey(iCur)), tol);
} }
//On traite les Vertices //Vertices are processed
parents.Clear(); parents.Clear();
TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, parents); TopExp::MapShapesAndAncestors(aShape, TopAbs_VERTEX, TopAbs_EDGE, parents);
TColStd_MapOfTransient Initialized; TColStd_MapOfTransient Initialized;
@ -1410,13 +1406,13 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves()); BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
const TopLoc_Location& Eloc = E.Location(); const TopLoc_Location& Eloc = E.Location();
while (itcr.More()) { while (itcr.More()) {
// Pour chaque CurveRepresentation, on verifie le parametre fourni // For each CurveRepresentation, check the provided parameter
const Handle(BRep_CurveRepresentation)& cr = itcr.Value(); const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
const TopLoc_Location& loc = cr->Location(); const TopLoc_Location& loc = cr->Location();
TopLoc_Location L = (Eloc * loc); TopLoc_Location L = (Eloc * loc);
if (cr->IsCurve3D()) { if (cr->IsCurve3D()) {
const Handle(Geom_Curve)& C = cr->Curve3D(); const Handle(Geom_Curve)& C = cr->Curve3D();
if (!C.IsNull()) { // edge non degenere if (!C.IsNull()) { // edge non degenerated
p3d = C->Value(par); p3d = C->Value(par);
p3d.Transform(L.Transformation()); p3d.Transform(L.Transformation());
box.Add(p3d); box.Add(p3d);
@ -1449,8 +1445,8 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
tol = Max(tol,sqrt(aXmax*aXmax+aYmax*aYmax+aZmax*aZmax)); tol = Max(tol,sqrt(aXmax*aXmax+aYmax*aYmax+aZmax*aZmax));
tol += 2.*Epsilon(tol); tol += 2.*Epsilon(tol);
if (verifyTolerance) { if (verifyTolerance) {
// On force la tolerance a sa valeur minimale // ASet minimum value of the tolerance
// Attention au partage du vertex par d'autre shapes // Attention to sharing of the vertex by other shapes
const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*)&V.TShape()); const Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*)&V.TShape());
if (Initialized.Add(TV)) if (Initialized.Add(TV))
TV->Tolerance(tol); TV->Tolerance(tol);
@ -1458,8 +1454,8 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
B.UpdateVertex(V, tol); B.UpdateVertex(V, tol);
} }
else { else {
// Update ne peut que augmenter la tolerance, donc si le vertex a // Update can only increase tolerance, so if the edge has a greater
// une tolerance + grande que ses edges on y touche pas // tolerance than its faces it is not concerned
B.UpdateVertex(V, tol); B.UpdateVertex(V, tol);
} }
} }
@ -1471,7 +1467,7 @@ void BRepLib::UpdateTolerances(const TopoDS_Shape& aShape,
//======================================================================= //=======================================================================
Standard_Boolean BRepLib::OrientClosedSolid(TopoDS_Solid& solid) Standard_Boolean BRepLib::OrientClosedSolid(TopoDS_Solid& solid)
{ {
// On met la matiere a l'interieur du solid // Set material inside the solid
BRepClass3d_SolidClassifier where(solid); BRepClass3d_SolidClassifier where(solid);
where.PerformInfinitePoint(Precision::Confusion()); where.PerformInfinitePoint(Precision::Confusion());
if (where.State()==TopAbs_IN) { if (where.State()==TopAbs_IN) {
@ -1485,8 +1481,8 @@ Standard_Boolean BRepLib::OrientClosedSolid(TopoDS_Solid& solid)
//======================================================================= //=======================================================================
//function : tgtfaces //function : tgtfaces
//purpose : controle de l angle a la frontiere entre 2 carreaux. //purpose : check the angle at the border between two squares.
// Les deux carreaux doivent partager leur edge frontiere. // Two shares should have a shared front edge.
//======================================================================= //=======================================================================
static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed, static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
@ -1526,8 +1522,8 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
Standard_Boolean IsInitialized = Standard_False; Standard_Boolean IsInitialized = Standard_False;
eps = (l - f)/100.; eps = (l - f)/100.;
f += eps; // pour eviter de faire des calculs sur les f += eps; // to avoid calculations on
l -= eps; // pointes des carreaux pointus. l -= eps; // points of pointed squares.
gp_Pnt2d p; gp_Pnt2d p;
gp_Pnt pp1,pp2;//,PP; gp_Pnt pp1,pp2;//,PP;
gp_Vec du,dv; gp_Vec du,dv;
@ -1537,7 +1533,7 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
Standard_Integer i; Standard_Integer i;
Standard_Boolean Nok; Standard_Boolean Nok;
for(i = 0; (i<= 20) && (angmax<=ta) ; i++){ for(i = 0; (i<= 20) && (angmax<=ta) ; i++){
// On suppose d'abord que c'est sameParameter // First suppose that this is sameParameter
Nok = Standard_True; Nok = Standard_True;
u = f + (l-f)*i/20; u = f + (l-f)*i/20;
HC2d1->D0(u,p); HC2d1->D0(u,p);
@ -1557,7 +1553,7 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
if(rev2) d2.Reverse(); if(rev2) d2.Reverse();
if (Nok) ang = d1.Angle(d2); if (Nok) ang = d1.Angle(d2);
if (Nok &&(ang > ta)) { // On raffine par projection if (Nok &&(ang > ta)) { // Refine by projection
if (! IsInitialized ) { if (! IsInitialized ) {
ext.Initialize(C2,f,l,Precision::PConfusion()); ext.Initialize(C2,f,l,Precision::PConfusion());
IsInitialized = Standard_True; IsInitialized = Standard_True;
@ -1588,8 +1584,8 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed,
//======================================================================= //=======================================================================
// function : EncodeRegularity // function : EncodeRegularity
// purpose : code les regularites sur tous les edges du shape,frontiere // purpose : code the regularities on all edges of the shape, boundary of
// de deux faces qui n en ont pas. // two faces that do not have it.
//======================================================================= //=======================================================================
void BRepLib::EncodeRegularity(const TopoDS_Shape& S, void BRepLib::EncodeRegularity(const TopoDS_Shape& S,
@ -1615,7 +1611,7 @@ void BRepLib::EncodeRegularity(const TopoDS_Shape& S,
} }
} }
} }
if (!found && !F1.IsNull()){//est ce un edge de couture? if (!found && !F1.IsNull()){//is it a sewing edge?
TopAbs_Orientation orE = E.Orientation(); TopAbs_Orientation orE = E.Orientation();
TopoDS_Edge curE; TopoDS_Edge curE;
for(Ex.Init(F1,TopAbs_EDGE);Ex.More() && !found;Ex.Next()){ for(Ex.Init(F1,TopAbs_EDGE);Ex.More() && !found;Ex.Next()){
@ -1639,7 +1635,7 @@ void BRepLib::EncodeRegularity(const TopoDS_Shape& S,
//======================================================================= //=======================================================================
// function : EncodeRegularity // function : EncodeRegularity
// purpose : code la regularite entre 2 face sur une edge // purpose : code the regularity between 2 faces on an edge
//======================================================================= //=======================================================================
void BRepLib::EncodeRegularity(TopoDS_Edge& E, void BRepLib::EncodeRegularity(TopoDS_Edge& E,

View File

@ -128,22 +128,20 @@ void BRepLib_MakeWire::Add(const TopoDS_Wire& W)
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : //purpose :
// PMN 19/03/1998 Pour des Probleme de performances on n'utilise pas // PMN 19/03/1998 For the Problem of performance TopExp::Vertices are not used on wire
// TopExp::Vertices sur des wire // PMN 10/09/1998 In case if the wire is previously closed (or degenerated)
// PMN 10/09/1998 Dans le cas ou le wire est precedament ferme (ou degenere) // TopExp::Vertices is used to reduce the ambiguity.
// on emploie quand meme TopExp::Vertices ... Afin de lever
// les ambiguites.
//======================================================================= //=======================================================================
void BRepLib_MakeWire::Add(const TopoDS_Edge& E) void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
{ {
Standard_Boolean forward = Standard_False; Standard_Boolean forward = Standard_False;
// pour dire si on decider d'ajouter forward // to tell if it has been decided to add forward
Standard_Boolean reverse = Standard_False; Standard_Boolean reverse = Standard_False;
// pour dire si on decide d'ajouter reversed // to tell if it has been decided to add reversed
Standard_Boolean init = Standard_False; Standard_Boolean init = Standard_False;
// Pour savoir s'il on doit calculer VL, VF // To know if it is necessary to calculate VL, VF
BRep_Builder B; BRep_Builder B;
TopoDS_Iterator it; TopoDS_Iterator it;
@ -161,7 +159,7 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
} }
else { else {
init = myShape.Closed(); // Si c'est ferme, on ne controle init = myShape.Closed(); // If it is closed no control
TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD); TopoDS_Shape aLocalShape = E.Oriented(TopAbs_FORWARD);
TopoDS_Edge EE = TopoDS::Edge(aLocalShape); TopoDS_Edge EE = TopoDS::Edge(aLocalShape);
// TopoDS_Edge EE = TopoDS::Edge(E.Oriented(TopAbs_FORWARD)); // TopoDS_Edge EE = TopoDS::Edge(E.Oriented(TopAbs_FORWARD));
@ -185,9 +183,9 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
connected = Standard_True; connected = Standard_True;
myVertex = VE; myVertex = VE;
if (myError != BRepLib_NonManifoldWire) { if (myError != BRepLib_NonManifoldWire) {
// l est on toujours ? // is it always so ?
if (VF.IsSame(VL)) { if (VF.IsSame(VL)) {
// Orientation indetermine (en 3d) : On garde l'init // Orientation indetermined (in 3d) : Preserve the initial
if (!VF.IsSame(VE)) myError = BRepLib_NonManifoldWire; if (!VF.IsSame(VE)) myError = BRepLib_NonManifoldWire;
} }
else { else {
@ -224,9 +222,9 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
(l < BRep_Tool::Tolerance(VW))) { (l < BRep_Tool::Tolerance(VW))) {
copyedge = Standard_True; copyedge = Standard_True;
if (myError != BRepLib_NonManifoldWire) { if (myError != BRepLib_NonManifoldWire) {
// l est on toujours ? // is it always so ?
if (VF.IsSame(VL)) { if (VF.IsSame(VL)) {
// Orientation indetermine (en 3d) : On garde l'init // Orientation indetermined (in 3d) : Preserve the initial
if (!VF.IsSame(VW)) myError = BRepLib_NonManifoldWire; if (!VF.IsSame(VW)) myError = BRepLib_NonManifoldWire;
} }
else { else {
@ -320,12 +318,12 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
} }
} }
} }
// On decide ici de l'orientation de l'arete // Make a decision about the orientation of the edge
// S'il y a ambiguite (en 3d) on garde l'orientation donnee en entree // If there is an ambiguity (in 3d) preserve the orientation given at input
// Cas d'ambiguite : // Case of ambiguity :
// reverse et forward sont faux car on n'a rien decider : // reverse and forward are false as nothing has been decided :
// wire ferme, vertex interne ... // closed wire, internal vertex ...
// reverse et forward sont vrai : Edge ferme ou degenere // reverse and forward are true : closed or degenerated edge
if ( ((forward == reverse) && (E.Orientation() == TopAbs_REVERSED)) || if ( ((forward == reverse) && (E.Orientation() == TopAbs_REVERSED)) ||
( reverse && !forward) ) myEdge.Reverse(); ( reverse && !forward) ) myEdge.Reverse();
} }
@ -344,20 +342,20 @@ void BRepLib_MakeWire::Add(const TopoDS_Edge& E)
else if (V2.IsSame(myVertex)) VRef = V1; else if (V2.IsSame(myVertex)) VRef = V1;
else { else {
#if DEB #if DEB
cout << "MakeWire : Y A UN PROBLEME !!" << endl; cout << "MakeWire : There is a PROBLEM !!" << endl;
#endif #endif
myError = BRepLib_NonManifoldWire; myError = BRepLib_NonManifoldWire;
} }
if (VF.IsSame(VL)) { if (VF.IsSame(VL)) {
// Cas particulier: il faut controler les orientations // Particular case: it is required to control the orientation
#if DEB #if DEB
if (!VF.IsSame(myVertex)) if (!VF.IsSame(myVertex))
cout << "MakeWire : Y A UN PROBLEME !!" << endl; cout << "MakeWire : There is a PROBLEM !!" << endl;
#endif #endif
} }
else { // Cas general else { // General case
if (VF.IsSame(myVertex)) VF = VRef; if (VF.IsSame(myVertex)) VF = VRef;
else if (VL.IsSame(myVertex)) VL = VRef; else if (VL.IsSame(myVertex)) VL = VRef;
else { else {

View File

@ -224,7 +224,7 @@ void BRepLib_MakeWire::Add(const TopTools_ListOfShape& L)
if (noCandidat) { if (noCandidat) {
theEdges.Clear(); theEdges.Clear();
// Some Edges are not connected to first edge and the diagnosis is as follows // Some Edges are not connected to first edge and the diagnosis is as follows
// but the le "Maker" is Done() because otherwise it is not possible to return the constructed connected part... // but the "Maker" is Done() because otherwise it is not possible to return the constructed connected part...
myError=BRepLib_DisconnectedWire; myError=BRepLib_DisconnectedWire;
} }
else theEdges.Remove(itMOS.Key()); else theEdges.Remove(itMOS.Key());

View File

@ -171,14 +171,14 @@ void BRepMAT2d_LinkTopoBilo::LinkToWire(const TopoDS_Wire& W,
} }
//----------------------------------------------------- //-----------------------------------------------------
// Construction Liens BasicElt => Curve du contour IndC. // Construction Links BasicElt => Curve of contour IndC.
//----------------------------------------------------- //-----------------------------------------------------
LinkToContour(Explo,IndC,BiLo,LinkBECont); LinkToContour(Explo,IndC,BiLo,LinkBECont);
//--------------------------------------------------------------- //---------------------------------------------------------------
// Iteration sur les BasicElts. L indice associe est le meme pour // Iteration on BasicElts. The associated index is the same for
// les courbes du contour et les edges. . // the curves of the contour and the edges. .
//--------------------------------------------------------------- //---------------------------------------------------------------
for (Ite.Initialize(LinkBECont); Ite.More(); Ite.Next()) { for (Ite.Initialize(LinkBECont); Ite.More(); Ite.Next()) {
BE = BiLo.Graph()->BasicElt(Ite.Key()); BE = BiLo.Graph()->BasicElt(Ite.Key());
@ -210,8 +210,8 @@ void BRepMAT2d_LinkTopoBilo::LinkToWire(const TopoDS_Wire& W,
//======================================================================= //=======================================================================
//function : LinkToContour //function : LinkToContour
//purpose : Association a chaque basicElt de la courbe du contour initial //purpose : Association to each basicElt of the curre of the initial
// dont il provient. // contour from which it comes.
//======================================================================= //=======================================================================
void LinkToContour (const BRepMAT2d_Explorer& Explo, void LinkToContour (const BRepMAT2d_Explorer& Explo,
@ -227,14 +227,14 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
Standard_Integer NbSect,ISect; Standard_Integer NbSect,ISect;
//--------------------------------------------------- //---------------------------------------------------
// NbSect : nombre de sections sur la courbe courrant. // NbSect : number of sections on the current curve.
// ISect : Compteur sur les sections. // ISect : Counter on sections.
//--------------------------------------------------- //---------------------------------------------------
const TColGeom2d_SequenceOfCurve& Cont = Explo.Contour(IndC); const TColGeom2d_SequenceOfCurve& Cont = Explo.Contour(IndC);
//------------------------------------------------------------------ //------------------------------------------------------------------
//Initialisation de l explorateur sur la premiere courbe du contour. //Initialization of the explorer on the first curve of the contour.
//------------------------------------------------------------------ //------------------------------------------------------------------
Standard_Integer IndOnCont = 1; Standard_Integer IndOnCont = 1;
Standard_Integer PrecIndOnCont = -1; Standard_Integer PrecIndOnCont = -1;
@ -242,8 +242,8 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
ISect = 0; ISect = 0;
//------------------------------------------------------------------ //------------------------------------------------------------------
// Parcours des elements de base associes au contour IndC. // Parsing of base elements associated to contour IndC.
// Rq : les elements de base sont ordonnes. // Rq : the base elements are ordered.
//------------------------------------------------------------------ //------------------------------------------------------------------
for (Standard_Integer i = 1; i <= BiLo.NumberOfElts(IndC); i++) { for (Standard_Integer i = 1; i <= BiLo.NumberOfElts(IndC); i++) {
@ -253,9 +253,9 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
if (Type != STANDARD_TYPE(Geom2d_CartesianPoint)) { if (Type != STANDARD_TYPE(Geom2d_CartesianPoint)) {
ISect++; ISect++;
//-------------------------------------------------------------------- //----------------------------------------------------------------
// l element de base est une courbe on lui associe la courbe courante. // The base element is a curve associated with the current curve.
//-------------------------------------------------------------------- //----------------------------------------------------------------
if (DirectSense) { if (DirectSense) {
Link.Bind(BE->Index(), IndOnCont); Link.Bind(BE->Index(), IndOnCont);
} }
@ -264,9 +264,9 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
} }
} }
else { else {
//-------------------------------------------------------------------- //-----------------------------------------------------------------
// l element de base est un point on lui associe la courbe precedente // The base element is a point associated with the previous curve.
//-------------------------------------------------------------------- //-----------------------------------------------------------------
if (DirectSense || LastPoint) { if (DirectSense || LastPoint) {
Link.Bind(BE->Index(), PrecIndOnCont); Link.Bind(BE->Index(), PrecIndOnCont);
} }
@ -277,8 +277,8 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
PrecIndOnCont = IndOnCont; PrecIndOnCont = IndOnCont;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Passage a la courbe suivante dans Explo, lorsqu on a parcouru toutes // Passage to the next curve in Explo, when all parts
// les portions de courbes correspondante a la courbe initiale. // of curves corresponding to the initial curve have been parsed.
//--------------------------------------------------------------------- //---------------------------------------------------------------------
if (Type != STANDARD_TYPE(Geom2d_CartesianPoint) && ISect == NbSect) { if (Type != STANDARD_TYPE(Geom2d_CartesianPoint) && ISect == NbSect) {
if (IndOnCont < Cont.Length() && DirectSense) { if (IndOnCont < Cont.Length() && DirectSense) {
@ -288,7 +288,7 @@ void LinkToContour (const BRepMAT2d_Explorer& Explo,
} }
else { else {
//----------------------------------------------------- //-----------------------------------------------------
// Pour les lignes ouvertes on repart dans l autre sens. // For open lines restart in the other direction.
//----------------------------------------------------- //-----------------------------------------------------
if (!DirectSense) { if (!DirectSense) {
IndOnCont--; IndOnCont--;

View File

@ -540,7 +540,7 @@ static void filterParameters(const TColStd_IndexedMapOfReal& theParams,
TCollection_CompareOfReal aCompare; TCollection_CompareOfReal aCompare;
SortTools_ShellSortOfReal::Sort(aParamArray, aCompare); SortTools_ShellSortOfReal::Sort(aParamArray, aCompare);
// mandadory pre filtering using the first (minimal) filter value // mandadory pre-filtering using the first (minimal) filter value
Standard_Real aP1, aP2; Standard_Real aP1, aP2;
aP1 = aParamArray(1); aP1 = aParamArray(1);
aParamTmp.Append(aP1); aParamTmp.Append(aP1);
@ -625,7 +625,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
gp_Pnt2d p2d; gp_Pnt2d p2d;
gp_Pnt p3d; gp_Pnt p3d;
// travail suivant le type de surface // work following the type of surface
const BRepAdaptor_Surface& BS = *(BRepAdaptor_Surface*)&(theCaro->Surface()); const BRepAdaptor_Surface& BS = *(BRepAdaptor_Surface*)&(theCaro->Surface());
GeomAbs_SurfaceType thetype = theCaro->GetType(); GeomAbs_SurfaceType thetype = theCaro->GetType();
@ -792,12 +792,11 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
if (R < r) if (R < r)
{ {
// comme on recupere les points des edges. // As the points of edges are returned.
// dans ce cas, les points ne sont pas representatifs. // in this case, the points are not representative.
//-- On choisit DeltaX et DeltaY de facon a ce qu on ne saute pas //-- Choose DeltaX and DeltaY so that to avoid skipping points on the grid
//-- de points sur la grille for (i = 0; i <= nbU; i++) ParamU.Append(umin + i* Du);
for (i = 0; i <= nbU; i++) ParamU.Append(umin + i* Du);
}//R<r }//R<r
else //U if R > r else //U if R > r
{ {
@ -808,7 +807,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
TColStd_Array1OfReal Up(1,LenU); TColStd_Array1OfReal Up(1,LenU);
for (j = 1; j <= LenU; j++) Up(j) = myUParam(j); for (j = 1; j <= LenU; j++) Up(j) = myUParam(j);
// Calculate DU, sort array of parameters // Calculate DU, leave array of parameters
Standard_Real aDU = FUN_CalcAverageDUV(Up,LenU); Standard_Real aDU = FUN_CalcAverageDUV(Up,LenU);
aDU = Max(aDU, Abs(umax - umin) / (Standard_Real) nbU / 2.); aDU = Max(aDU, Abs(umax - umin) / (Standard_Real) nbU / 2.);
Standard_Real dUstd = Abs(umax - umin) / (Standard_Real) LenU; Standard_Real dUstd = Abs(umax - umin) / (Standard_Real) LenU;
@ -1071,7 +1070,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
} }
} }
// recuperation du tableau de parametres V: // return table of parameters V:
Standard_Integer NV = tabGU[imax].NbPoints(); Standard_Integer NV = tabGU[imax].NbPoints();
for (i = 1; i <= NV; i++) { for (i = 1; i <= NV; i++) {
ParamV.Append(tabGU[imax].Parameter(i)); ParamV.Append(tabGU[imax].Parameter(i));
@ -1094,7 +1093,7 @@ void BRepMesh_FastDiscretFace::InternalVertices(const Handle(BRepAdaptor_HSurfac
} }
} }
// recuperation du tableau de parametres U: // return table of parameters U:
Standard_Integer NU = tabGV[imax].NbPoints(); Standard_Integer NU = tabGV[imax].NbPoints();
for (i = 1; i <= NU; i++) { for (i = 1; i <= NU; i++) {
ParamU.Append(tabGV[imax].Parameter(i)); ParamU.Append(tabGV[imax].Parameter(i));
@ -1597,7 +1596,7 @@ void BRepMesh_FastDiscretFace::AddInShape(const TopoDS_Face& theFace,
T->Deflection(theDefFace); T->Deflection(theDefFace);
// stockage de la triangulation dans la BRep. // storage of triangulation in BRep.
BRep_Builder B1; BRep_Builder B1;
//TopLoc_Location loc = theFace.Location(); //TopLoc_Location loc = theFace.Location();
if (!loc.IsIdentity()) { if (!loc.IsIdentity()) {
@ -1608,7 +1607,7 @@ void BRepMesh_FastDiscretFace::AddInShape(const TopoDS_Face& theFace,
} }
B1.UpdateFace(theFace, T); B1.UpdateFace(theFace, T);
// mise en place des polygones sur triangulation dans la face: // implement polygons on triangulation in the face:
BRepMesh_DataMapIteratorOfDataMapOfShapePairOfPolygon It(myInternaledges); BRepMesh_DataMapIteratorOfDataMapOfShapePairOfPolygon It(myInternaledges);
for (; It.More(); It.Next()) { for (; It.More(); It.Next()) {
@ -1754,7 +1753,7 @@ static Standard_Boolean GetVertexParameters(const TopoDS_Vertex& theVert,
L = L.Predivided(theVert.Location()); L = L.Predivided(theVert.Location());
BRep_ListIteratorOfListOfPointRepresentation itpr = BRep_ListIteratorOfListOfPointRepresentation itpr =
((*((Handle(BRep_TVertex)*) &theVert.TShape()))->Points()); ((*((Handle(BRep_TVertex)*) &theVert.TShape()))->Points());
// On regarde dabord si il y des PointRepresentation (cas non Manifold) // Check first if there are PointRepresentation (case non Manifold)
while (itpr.More()) { while (itpr.More()) {
if (itpr.Value()->IsPointOnSurface(S,L)) { if (itpr.Value()->IsPointOnSurface(S,L)) {
@ -1769,7 +1768,7 @@ static Standard_Boolean GetVertexParameters(const TopoDS_Vertex& theVert,
//======================================================================= //=======================================================================
//function : Add //function : Add
//purpose : method intended to addition internal myVertices in triangulation. //purpose : method intended to add internal myVertices in triangulation.
//======================================================================= //=======================================================================
void BRepMesh_FastDiscretFace::Add(const TopoDS_Vertex& theVert, void BRepMesh_FastDiscretFace::Add(const TopoDS_Vertex& theVert,
const TopoDS_Face& theFace, const TopoDS_Face& theFace,

View File

@ -85,7 +85,7 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
f = C.FirstParameter(); f = C.FirstParameter();
l = C.LastParameter(); l = C.LastParameter();
// Tangent si la regularite estaum moins G1. // Tangent if the regularity is at least G1.
if (BRep_Tool::HasContinuity(E,F1,F2)) { if (BRep_Tool::HasContinuity(E,F1,F2)) {
if (BRep_Tool::Continuity(E,F1,F2) > GeomAbs_C0) { if (BRep_Tool::Continuity(E,F1,F2) > GeomAbs_C0) {
BRepOffset_Interval I; BRepOffset_Interval I;
@ -95,9 +95,9 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
return; return;
} }
} }
// Premiere etape : Type determine par un des bout. // First stage : Type determined by one of ends.
// Calcul des normales et tangentes sur les courbes et surface. // Calculate normals and tangents on the curves and surface.
// normales sont dirigees vers l exterieur. // normals are oriented outwards.
Standard_Real ParOnC = 0.5*(f+l); Standard_Real ParOnC = 0.5*(f+l);
gp_Vec T1 = C.DN(ParOnC,1).Transformed(L.Transformation()); gp_Vec T1 = C.DN(ParOnC,1).Transformed(L.Transformation());
@ -133,15 +133,15 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
I.First(f); I.Last(l); I.First(f); I.Last(l);
if (Abs(NormProVec) < SinTol) { if (Abs(NormProVec) < SinTol) {
// plat // plane
if (DN1.Dot(DN2) > 0) { if (DN1.Dot(DN2) > 0) {
//Tangent //Tangent
I.Type(BRepOffset_Tangent); I.Type(BRepOffset_Tangent);
} }
else { else {
//Confondu pas fini! //Mixed not finished!
#ifdef DEB #ifdef DEB
cout <<" face localement confondues"<<endl; cout <<" faces locally mixed"<<endl;
#endif #endif
I.Type(BRepOffset_Convex); I.Type(BRepOffset_Convex);
} }
@ -151,11 +151,11 @@ static void EdgeAnalyse(const TopoDS_Edge& E,
ProVec.Normalize(); ProVec.Normalize();
Standard_Real Prod = T1.Dot(DN1^DN2); Standard_Real Prod = T1.Dot(DN1^DN2);
if (Prod > 0.) { if (Prod > 0.) {
//Saillant //
I.Type(BRepOffset_Convex); I.Type(BRepOffset_Convex);
} }
else { else {
//rentrant //reenters
I.Type(BRepOffset_Concave); I.Type(BRepOffset_Concave);
} }
} }
@ -174,7 +174,7 @@ static void BuildAncestors (const TopoDS_Shape& S,
TopExp::MapShapesAndAncestors(S,TopAbs_VERTEX,TopAbs_EDGE,MA); TopExp::MapShapesAndAncestors(S,TopAbs_VERTEX,TopAbs_EDGE,MA);
TopExp::MapShapesAndAncestors(S,TopAbs_EDGE ,TopAbs_FACE,MA); TopExp::MapShapesAndAncestors(S,TopAbs_EDGE ,TopAbs_FACE,MA);
// Purge des ancetres. // Purge ancestors.
TopTools_MapOfShape Map; TopTools_MapOfShape Map;
for (Standard_Integer i = 1; i <= MA.Extent(); i++) { for (Standard_Integer i = 1; i <= MA.Extent(); i++) {
Map.Clear(); Map.Clear();
@ -420,8 +420,8 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
TopoDS_Compound Co; TopoDS_Compound Co;
B.MakeCompound(Co); B.MakeCompound(Co);
B.Add(Co,Face); B.Add(Co,Face);
// on ajoute a Co toutes les faces constituant la nappe de faces // add to Co all faces from the cloud of faces
// G1 creee a partir de <Face> // G1 created from <Face>
AddFaces(Face,Co,Map,T); AddFaces(Face,Co,Map,T);
List.Append(Co); List.Append(Co);
} }
@ -448,8 +448,8 @@ void BRepOffset_Analyse::Explode( TopTools_ListOfShape& List,
TopoDS_Compound Co; TopoDS_Compound Co;
B.MakeCompound(Co); B.MakeCompound(Co);
B.Add(Co,Face); B.Add(Co,Face);
// on ajoute a Co toutes les faces constituant la nappe de faces // add to Co all faces from the cloud of faces
// G1 creee a partir de <Face> // G1 created from <Face>
AddFaces(Face,Co,Map,T1,T2); AddFaces(Face,Co,Map,T1,T2);
List.Append(Co); List.Append(Co);
} }
@ -473,7 +473,7 @@ void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
const BRepOffset_ListOfInterval& LI = Type(E); const BRepOffset_ListOfInterval& LI = Type(E);
if (!LI.IsEmpty() && LI.First().Type() == T) { if (!LI.IsEmpty() && LI.First().Type() == T) {
// alors ca y est <NewFace> est raccordee G1 a <Face> // so <NewFace> is attached to G1 by <Face>
const TopTools_ListOfShape& L = Ancestors(E); const TopTools_ListOfShape& L = Ancestors(E);
if (L.Extent() == 2) { if (L.Extent() == 2) {
TopoDS_Face F1 = TopoDS::Face(L.First()); TopoDS_Face F1 = TopoDS::Face(L.First());
@ -505,7 +505,7 @@ void BRepOffset_Analyse::AddFaces (const TopoDS_Face& Face,
const BRepOffset_ListOfInterval& LI = Type(E); const BRepOffset_ListOfInterval& LI = Type(E);
if (!LI.IsEmpty() && if (!LI.IsEmpty() &&
(LI.First().Type() == T1 || LI.First().Type() == T2)) { (LI.First().Type() == T1 || LI.First().Type() == T2)) {
// alors ca y est <NewFace> est raccordee G1 a <Face> // so <NewFace> is attached to G1 by <Face>
const TopTools_ListOfShape& L = Ancestors(E); const TopTools_ListOfShape& L = Ancestors(E);
if (L.Extent() == 2) { if (L.Extent() == 2) {
TopoDS_Face F1 = TopoDS::Face(L.First()); TopoDS_Face F1 = TopoDS::Face(L.First());

View File

@ -122,10 +122,9 @@ static void Store (const TopoDS_Edge& E1,
Standard_Real Tol) Standard_Real Tol)
{ {
//------------------------------------------------------------- //-------------------------------------------------------------
// Test si les points d intersection correspondent a des vertex // Test if the points of intersection correspond to existing
// existants.Sinon ajout dans les descendants des edges. // vertices. Otherwise add edges in the descendants.
// Remarque a ce stade seulement les vertex d intersection sont // Note: at this stage only vertices of intersection are in the descendants.
// dans les descendants.
//------------------------------------------------------------- //-------------------------------------------------------------
const TopTools_ListOfShape& VOnE1 = AsDes->Descendant(E1); const TopTools_ListOfShape& VOnE1 = AsDes->Descendant(E1);
const TopTools_ListOfShape& VOnE2 = AsDes->Descendant(E2); const TopTools_ListOfShape& VOnE2 = AsDes->Descendant(E2);
@ -154,7 +153,7 @@ static void Store (const TopoDS_Edge& E1,
if (!VOnE1.IsEmpty()) { if (!VOnE1.IsEmpty()) {
//----------------------------------------------------------------- //-----------------------------------------------------------------
// Recherche si le point d intersection correspond a un vertex de E1. // Find if the point of intersection corresponds to a vertex of E1.
//----------------------------------------------------------------- //-----------------------------------------------------------------
for (it.Initialize(VOnE1); it.More(); it.Next()) { for (it.Initialize(VOnE1); it.More(); it.Next()) {
P1 = BRep_Tool::Pnt(TopoDS::Vertex(it.Value())); P1 = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
@ -169,7 +168,7 @@ static void Store (const TopoDS_Edge& E1,
if (!VOnE2.IsEmpty()) { if (!VOnE2.IsEmpty()) {
if (OnE1) { if (OnE1) {
//----------------------------------------------------------------- //-----------------------------------------------------------------
// Recherche si le vertex trouve sur E1 n est pas deja sur E2. // Find if the vertex found on E1 is not already on E2.
//----------------------------------------------------------------- //-----------------------------------------------------------------
for (it.Initialize(VOnE2); it.More(); it.Next()) { for (it.Initialize(VOnE2); it.More(); it.Next()) {
if (it.Value().IsSame(V)) { if (it.Value().IsSame(V)) {
@ -181,7 +180,7 @@ static void Store (const TopoDS_Edge& E1,
} }
for (it.Initialize(VOnE2); it.More(); it.Next()) { for (it.Initialize(VOnE2); it.More(); it.Next()) {
//----------------------------------------------------------------- //-----------------------------------------------------------------
// Recherche si le point d intersection correspond a un vertex de E2. // Find if the point of intersection corresponds to a vertex of E2.
//----------------------------------------------------------------- //-----------------------------------------------------------------
P2 = BRep_Tool::Pnt(TopoDS::Vertex(it.Value())); P2 = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
if (P.IsEqual(P2,Tol)) { if (P.IsEqual(P2,Tol)) {
@ -195,9 +194,9 @@ static void Store (const TopoDS_Edge& E1,
if (OnE1 && OnE2) { if (OnE1 && OnE2) {
if (!V1.IsSame(V2)) { if (!V1.IsSame(V2)) {
//--------------------------------------------------------------- //---------------------------------------------------------------
// Les deux vertex sont en fait les memes. // Two vertices are actually the same.
// on va remplacer V2 par V1. // V2 will be replaced by V1.
// mis a jour des parametres des vertex sur les edges. // update the parameters of vertex on edges.
//--------------------------------------------------------------- //---------------------------------------------------------------
Standard_Real UV2; Standard_Real UV2;
TopoDS_Edge EWE2; TopoDS_Edge EWE2;
@ -280,7 +279,7 @@ static void EdgeInter(const TopoDS_Face& F,
Standard_Real f[3],l[3]; Standard_Real f[3],l[3];
Standard_Real MilTol2 = 1000*Tol*Tol; Standard_Real MilTol2 = 1000*Tol*Tol;
Standard_Real TolDub = 1.e-7; // Faire un calcul plus malin !!! NYI Standard_Real TolDub = 1.e-7;
Standard_Integer i; Standard_Integer i;
BRep_Tool::Range(E1, f[1], l[1]); BRep_Tool::Range(E1, f[1], l[1]);
@ -373,17 +372,17 @@ static void EdgeInter(const TopoDS_Face& F,
#ifdef DEB #ifdef DEB
if (aT1 < f[1]-Tol || aT1 > l[1]+Tol) if (aT1 < f[1]-Tol || aT1 > l[1]+Tol)
{ {
cout << "hors borne"<<endl; cout << "out of limit"<<endl;
cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<endl; cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<endl;
} }
if (aT2 < f[2]-Tol || aT2 > l[2]+Tol) if (aT2 < f[2]-Tol || aT2 > l[2]+Tol)
{ {
cout << "hors borne"<<endl; cout << "out of limit"<<endl;
cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<endl; cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<endl;
} }
if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol) if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol)
{ {
cout << "Inter2d : Solution rejete "<<endl; cout << "Inter2d : Solution rejected "<<endl;
cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl; cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl;
cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<endl; cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<endl;
cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<endl; cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<endl;
@ -421,7 +420,7 @@ static void EdgeInter(const TopoDS_Face& F,
} }
//---------------------------------- //----------------------------------
// Test en bout. // Test at end.
//--------------------------------- //---------------------------------
Standard_Real U1,U2; Standard_Real U1,U2;
Standard_Real TolConf = Tol; Standard_Real TolConf = Tol;
@ -470,8 +469,8 @@ static void EdgeInter(const TopoDS_Face& F,
if ( !LV1.IsEmpty()) { if ( !LV1.IsEmpty()) {
//---------------------------------- //----------------------------------
// Purge de l ensemble des vertex. // Remove all vertices.
// il peut y avoir des doublons // There can be doubles
//---------------------------------- //----------------------------------
TopTools_ListIteratorOfListOfShape it1LV1,it1LV2,it2LV1; TopTools_ListIteratorOfListOfShape it1LV1,it1LV2,it2LV1;
gp_Pnt P1,P2; gp_Pnt P1,P2;
@ -497,7 +496,7 @@ static void EdgeInter(const TopoDS_Face& F,
// Modified by skv - Thu Jan 22 18:19:05 2004 OCC4455 End // Modified by skv - Thu Jan 22 18:19:05 2004 OCC4455 End
LV1.Remove(it1LV1); LV1.Remove(it1LV1);
LV2.Remove(it1LV2); LV2.Remove(it1LV2);
if (AffichPurge) cout <<"Doublons purges dans EdgeInter."<<endl; if (AffichPurge) cout <<"Doubles removed in EdgeInter."<<endl;
Purge = Standard_True; Purge = Standard_True;
break; break;
} }
@ -509,7 +508,7 @@ static void EdgeInter(const TopoDS_Face& F,
} }
} }
//--------------------------------- //---------------------------------
// Stockage vertex en SD. // Vertex storage in DS.
//--------------------------------- //---------------------------------
// Modified by skv - Tue Jan 13 15:14:30 2004 Begin // Modified by skv - Tue Jan 13 15:14:30 2004 Begin
Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
@ -537,7 +536,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
{ {
#ifdef DRAW #ifdef DRAW
if (AffichInt2d) { if (AffichInt2d) {
//POP pour NT //POP for NT
char* name = new char[100]; char* name = new char[100];
sprintf(name,"E2d_%d_%d",NbF2d,NbE2d++); sprintf(name,"E2d_%d_%d",NbF2d,NbE2d++);
DBRep::Set(name,E1); DBRep::Set(name,E1);
@ -551,7 +550,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
Standard_Real f[3],l[3]; Standard_Real f[3],l[3];
Standard_Real MilTol2 = 1000*Tol*Tol; Standard_Real MilTol2 = 1000*Tol*Tol;
Standard_Real TolDub = 1.e-7; // Faire un calcul plus malin !!! NYI Standard_Real TolDub = 1.e-7;
Standard_Integer i; Standard_Integer i;
//BRep_Tool::Range(E1, f[1], l[1]); //BRep_Tool::Range(E1, f[1], l[1]);
@ -641,17 +640,17 @@ static void RefEdgeInter(const TopoDS_Face& F,
#ifdef DEB #ifdef DEB
if (aT1 < f[1]-Tol || aT1 > l[1]+Tol) if (aT1 < f[1]-Tol || aT1 > l[1]+Tol)
{ {
cout << "hors borne"<<endl; cout << "out of limit"<<endl;
cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<endl; cout<<"aT1 = "<<aT1<<", f[1] = "<<f[1]<<", l[1] = "<<l[1]<<endl;
} }
if (aT2 < f[2]-Tol || aT2 > l[2]+Tol) if (aT2 < f[2]-Tol || aT2 > l[2]+Tol)
{ {
cout << "hors borne"<<endl; cout << "out of limit"<<endl;
cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<endl; cout<<"aT2 = "<<aT2<<", f[2] = "<<f[2]<<", l[2] = "<<l[2]<<endl;
} }
if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol) if (P1.SquareDistance(P) > MilTol2 || P2.SquareDistance(P) > MilTol2 || P1.Distance(P2) > 2.*Tol)
{ {
cout << "Inter2d : Solution rejete "<<endl; cout << "Inter2d : Solution rejected"<<endl;
cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl; cout<<"P = "<<P.X()<<" "<<P.Y()<<" "<<P.Z()<<endl;
cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<endl; cout<<"P1 = "<<P1.X()<<" "<<P1.Y()<<" "<<P1.Z()<<endl;
cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<endl; cout<<"P2 = "<<P2.X()<<" "<<P2.Y()<<" "<<P2.Z()<<endl;
@ -688,7 +687,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
} }
//---------------------------------- //----------------------------------
// Test en bout. // Test at end.
//--------------------------------- //---------------------------------
Standard_Real U1,U2; Standard_Real U1,U2;
Standard_Real TolConf = Tol; Standard_Real TolConf = Tol;
@ -725,8 +724,8 @@ static void RefEdgeInter(const TopoDS_Face& F,
if ( !LV1.IsEmpty()) { if ( !LV1.IsEmpty()) {
//---------------------------------- //----------------------------------
// Purge de l ensemble des vertex. // Remove all vertices.
// il peut y avoir des doublons // there can be doubles
//---------------------------------- //----------------------------------
TopTools_ListIteratorOfListOfShape it1LV1,it1LV2,it2LV1; TopTools_ListIteratorOfListOfShape it1LV1,it1LV2,it2LV1;
gp_Pnt P1,P2; gp_Pnt P1,P2;
@ -745,7 +744,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
if (P1.IsEqual(P2,10*Tol)) { if (P1.IsEqual(P2,10*Tol)) {
LV1.Remove(it1LV1); LV1.Remove(it1LV1);
LV2.Remove(it1LV2); LV2.Remove(it1LV2);
if (AffichPurge) cout <<"Doublons purges dans EdgeInter."<<endl; if (AffichPurge) cout <<"Doubles removed in EdgeInter."<<endl;
Purge = Standard_True; Purge = Standard_True;
break; break;
} }
@ -757,7 +756,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
} }
} }
//--------------------------------- //---------------------------------
// Stockage vertex en SD. // Vertex storage in SD.
//--------------------------------- //---------------------------------
////----------------------------------------------------- ////-----------------------------------------------------
if(LV1.Extent() > 1) { if(LV1.Extent() > 1) {
@ -931,8 +930,8 @@ static void ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const Standard_Real
BRep_Tool::Range(E, anEf, anEl); BRep_Tool::Range(E, anEf, anEl);
NE = TopoDS::Edge(aLocalShape); NE = TopoDS::Edge(aLocalShape);
// NE = TopoDS::Edge(E.EmptyCopied()); // NE = TopoDS::Edge(E.EmptyCopied());
// Suffit pour les edges analytiques, pour le cas general reconstruire la // Enough for analytic edges, for general case reconstruct the
// la geometrie de l edge en recalculant l intersection des surfaces. // geometry of the edge recalculating the intersection of surfaces.
//BRepLib::BuildCurve3d(E); //BRepLib::BuildCurve3d(E);
@ -1412,14 +1411,14 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
EdgesOfFace.Add( Explo.Current() ); EdgesOfFace.Add( Explo.Current() );
//----------------------------------------------------------- //-----------------------------------------------------------
// calcul des intersections2d sur les faces touchees par les // calculate intersections2d on faces touched by
// intersection3d // intersection3d
//--------------------------------------------------------- //---------------------------------------------------------
TopTools_ListIteratorOfListOfShape it1LE ; TopTools_ListIteratorOfListOfShape it1LE ;
TopTools_ListIteratorOfListOfShape it2LE ; TopTools_ListIteratorOfListOfShape it2LE ;
//----------------------------------------------- //-----------------------------------------------
// Intersection des edges 2 a 2. // Intersection of edges 2*2.
//----------------------------------------------- //-----------------------------------------------
const TopTools_ListOfShape& LE = AsDes->Descendant(F); const TopTools_ListOfShape& LE = AsDes->Descendant(F);
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
@ -1433,8 +1432,8 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)& AsDes,
while (j < i && it2LE.More()) { while (j < i && it2LE.More()) {
const TopoDS_Edge& E2 = TopoDS::Edge(it2LE.Value()); const TopoDS_Edge& E2 = TopoDS::Edge(it2LE.Value());
//-------------------------------------------------------------- //--------------------------------------------------------------
// Intersectionns des Nouvelles edges obtenues par intersection // Intersections of New edges obtained by intersection
// entre elles et avec les edges de restictions // between them and with edges of restrictions
//------------------------------------------------------ //------------------------------------------------------
if ( (!EdgesOfFace.Contains(E1) || !EdgesOfFace.Contains(E2)) && if ( (!EdgesOfFace.Contains(E1) || !EdgesOfFace.Contains(E2)) &&
(NewEdges.Contains(E1) || NewEdges.Contains(E2)) ) { (NewEdges.Contains(E1) || NewEdges.Contains(E2)) ) {
@ -1471,7 +1470,7 @@ void BRepOffset_Inter2d::ConnexIntByInt
BRepOffset_Tool::MapVertexEdges(FI,MVE); BRepOffset_Tool::MapVertexEdges(FI,MVE);
//--------------------- //---------------------
// Extension des edges. // Extension of edges.
//--------------------- //---------------------
TopoDS_Edge NE; TopoDS_Edge NE;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(MVE); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(MVE);
@ -1538,7 +1537,7 @@ void BRepOffset_Inter2d::ConnexIntByInt
// TopoDS_Edge CEO = TopoDS::Edge(OFI.Generated(CurE)); // TopoDS_Edge CEO = TopoDS::Edge(OFI.Generated(CurE));
// TopoDS_Edge NEO = TopoDS::Edge(OFI.Generated(NextE)); // TopoDS_Edge NEO = TopoDS::Edge(OFI.Generated(NextE));
//------------------------------------------ //------------------------------------------
//traitement Inter des images de CurE NextE. // Inter processing of images of CurE NextE.
//------------------------------------------ //------------------------------------------
TopTools_ListOfShape LV1,LV2; TopTools_ListOfShape LV1,LV2;
Standard_Boolean DoInter = 1; Standard_Boolean DoInter = 1;

View File

@ -60,8 +60,8 @@ static void ExtentEdge(const TopoDS_Face& F,
// NE = TopoDS::Edge(E.EmptyCopied()); // NE = TopoDS::Edge(E.EmptyCopied());
// Suffit pour les edges analytiques, pour le cas general reconstruire la // Enough for analytic edges, in general case reconstruct the
// la geometrie de l edge en recalculant l intersection des surfaces. // geometry of the edge recalculating the intersection of surfaces.
NE.Orientation(TopAbs_FORWARD); NE.Orientation(TopAbs_FORWARD);
Standard_Real f,l; Standard_Real f,l;
@ -92,7 +92,7 @@ static void SelectEdge (const TopoDS_Face& F,
TopTools_ListOfShape& LInt) TopTools_ListOfShape& LInt)
{ {
//------------------------------------------------------------ //------------------------------------------------------------
// detrompeur sur les intersections sur les faces periodiques // Proofing on the intersections on periodical faces
//------------------------------------------------------------ //------------------------------------------------------------
TopTools_ListIteratorOfListOfShape it(LInt); TopTools_ListIteratorOfListOfShape it(LInt);
// Modified by Sergey KHROMOV - Wed Jun 5 11:43:04 2002 Begin // Modified by Sergey KHROMOV - Wed Jun 5 11:43:04 2002 Begin
@ -112,7 +112,7 @@ static void SelectEdge (const TopoDS_Face& F,
Extrema_ExtPC anExt; Extrema_ExtPC anExt;
// Modified by Sergey KHROMOV - Wed Jun 5 11:23:11 2002 End // Modified by Sergey KHROMOV - Wed Jun 5 11:23:11 2002 End
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Selection de l edge qui couvre le plus le domaine de l edge initiale. // Selection of edge that coversmost of the domain of the initial edge.
//---------------------------------------------------------------------- //----------------------------------------------------------------------
for (; it.More(); it.Next()) { for (; it.More(); it.Next()) {
const TopoDS_Edge& EI = TopoDS::Edge(it.Value()); const TopoDS_Edge& EI = TopoDS::Edge(it.Value());
@ -198,14 +198,14 @@ void BRepOffset_Inter3d::CompletInt(const TopTools_ListOfShape& SetOfFaces,
const BRepAlgo_Image& InitOffsetFace) const BRepAlgo_Image& InitOffsetFace)
{ {
//--------------------------------------------------------------- //---------------------------------------------------------------
// Calcul des intersections des offsetfaces entre elles // Calculate the intersections of offset faces
// Distinction des intersection entre faces // tangentes. // Distinction of intersection between faces // tangents.
//--------------------------------------------------------------- //---------------------------------------------------------------
TopoDS_Face F1,F2; TopoDS_Face F1,F2;
TopTools_ListIteratorOfListOfShape it; TopTools_ListIteratorOfListOfShape it;
//--------------------------------------------------------------- //---------------------------------------------------------------
// Construction des boites englobantes. // Construction of bounding boxes
//--------------------------------------------------------------- //---------------------------------------------------------------
TopOpeBRepTool_BoxSort BOS; TopOpeBRepTool_BoxSort BOS;
BRep_Builder B; BRep_Builder B;
@ -219,7 +219,7 @@ void BRepOffset_Inter3d::CompletInt(const TopTools_ListOfShape& SetOfFaces,
BOS.AddBoxesMakeCOB(CompOS,TopAbs_FACE); BOS.AddBoxesMakeCOB(CompOS,TopAbs_FACE);
//--------------------------- //---------------------------
// Intersection des faces // // Intersection of faces //
//--------------------------- //---------------------------
for (it.Initialize(SetOfFaces); it.More(); it.Next()) { for (it.Initialize(SetOfFaces); it.More(); it.Next()) {
const TopoDS_Face& F1 = TopoDS::Face(it.Value()); const TopoDS_Face& F1 = TopoDS::Face(it.Value());
@ -257,13 +257,13 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
if (BRepOffset_Tool::HasCommonShapes(F1,F2,LE,LV) || if (BRepOffset_Tool::HasCommonShapes(F1,F2,LE,LV) ||
myAsDes->HasCommonDescendant(F1,F2,LE)) { myAsDes->HasCommonDescendant(F1,F2,LE)) {
//------------------------------------------------- //-------------------------------------------------
// F1 et F2 partagent des shapes. // F1 and F2 share shapes.
//------------------------------------------------- //-------------------------------------------------
if ( LE.IsEmpty() && !LV.IsEmpty()) { if ( LE.IsEmpty() && !LV.IsEmpty()) {
if (InterPipes) { if (InterPipes) {
//---------------------------- //----------------------
// tuyaux partageant un vertex. // tubes share a vertex.
//---------------------------- //----------------------
const TopoDS_Edge& EE1 = TopoDS::Edge(InitF1); const TopoDS_Edge& EE1 = TopoDS::Edge(InitF1);
const TopoDS_Edge& EE2 = TopoDS::Edge(InitF2); const TopoDS_Edge& EE2 = TopoDS::Edge(InitF2);
TopoDS_Vertex VE1[2],VE2[2]; TopoDS_Vertex VE1[2],VE2[2];
@ -277,16 +277,16 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
} }
} }
} }
if (!InitOffsetFace.HasImage(V)) { //pas de sphere if (!InitOffsetFace.HasImage(V)) { //no sphere
BRepOffset_Tool::PipeInter(F1,F2,LInt1,LInt2,mySide); BRepOffset_Tool::PipeInter(F1,F2,LInt1,LInt2,mySide);
} }
} }
else { else {
//-------------------------------------------------------- //--------------------------------------------------------
// Intersection de faces n ayant que des vertex en communs. // Intersection having only common vertices
// et dont les supports avaient des edges en commun. // and supports having common edges.
// INSUFFISANT mais critere plus large secoue trop // UNSUFFICIENT, but a larger criterion shakes too
// les sections et le reste pour l instant. // many sections.
//-------------------------------------------------------- //--------------------------------------------------------
if (InterFaces && if (InterFaces &&
BRepOffset_Tool::HasCommonShapes(TopoDS::Face(InitF1), BRepOffset_Tool::HasCommonShapes(TopoDS::Face(InitF1),
@ -326,16 +326,15 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
TopoDS_Edge NullEdge; TopoDS_Edge NullEdge;
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// etape 1 : Intersections des face // correspondant a des faces // etape 1 : Intersection of faces // corresponding to the initial faces
// initiales separees par une edge concave si offset > 0, // separated by a concave edge if offset > 0, otherwise convex.
// convexe sinon.
//--------------------------------------------------------------------- //---------------------------------------------------------------------
for (; Exp.More(); Exp.Next()) { for (; Exp.More(); Exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(Exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
const BRepOffset_ListOfInterval& L = Analyse.Type(E); const BRepOffset_ListOfInterval& L = Analyse.Type(E);
if (!L.IsEmpty() && L.First().Type() == OT) { if (!L.IsEmpty() && L.First().Type() == OT) {
//----------------------------------------------------------- //-----------------------------------------------------------
// l edge est du bon type , recuperation des faces adjacentes. // edge is of the proper type , return adjacent faces.
//----------------------------------------------------------- //-----------------------------------------------------------
const TopTools_ListOfShape& Anc = Analyse.Ancestors(E); const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
if (Anc.Extent() == 2) { if (Anc.Extent() == 2) {
@ -349,11 +348,9 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
} }
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// etape 2 : Intersections des tuyaux partageant un vertex sans // etape 2 : Intersections of tubes sharing a vertex without sphere with:
// sphere avec: // - tubes on each other edge sharing the vertex
// - Soit les tuyaux sur chaque autre edge partageant le vertex // - faces containing an edge connected to vertex that has no tubes.
// - Soit avec les faces contenant une edge connexe au vertex
// qui n a pas de tuyaux.
//--------------------------------------------------------------------- //---------------------------------------------------------------------
TopoDS_Vertex V[2]; TopoDS_Vertex V[2];
TopTools_ListIteratorOfListOfShape it; TopTools_ListIteratorOfListOfShape it;
@ -362,7 +359,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
const TopoDS_Edge& E1 = TopoDS::Edge(Exp.Current()); const TopoDS_Edge& E1 = TopoDS::Edge(Exp.Current());
if (InitOffsetFace.HasImage(E1)) { if (InitOffsetFace.HasImage(E1)) {
//--------------------------- //---------------------------
// E1 a genere un tuyau. // E1 generated a tube.
//--------------------------- //---------------------------
F1 = TopoDS::Face(InitOffsetFace.Image(E1).First());; F1 = TopoDS::Face(InitOffsetFace.Image(E1).First());;
TopExp::Vertices(E1,V[0],V[1]); TopExp::Vertices(E1,V[0],V[1]);
@ -371,7 +368,7 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
for (Standard_Integer i = 0; i < 2; i++) { for (Standard_Integer i = 0; i < 2; i++) {
if (!InitOffsetFace.HasImage(V[i])) { if (!InitOffsetFace.HasImage(V[i])) {
//----------------------------- //-----------------------------
// le vertex n a pas de sphere. // the vertex has no sphere.
//----------------------------- //-----------------------------
const TopTools_ListOfShape& Anc = Analyse.Ancestors(V[i]); const TopTools_ListOfShape& Anc = Analyse.Ancestors(V[i]);
TopTools_ListOfShape TangOnV; TopTools_ListOfShape TangOnV;
@ -399,12 +396,12 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
// Modified by skv - Fri Jan 16 16:27:54 2004 OCC4455 End // Modified by skv - Fri Jan 16 16:27:54 2004 OCC4455 End
if (InitOffsetFace.HasImage(E2)) { if (InitOffsetFace.HasImage(E2)) {
//----------------------------- //-----------------------------
// E2 a genere un tuyau. // E2 generated a tube.
//----------------------------- //-----------------------------
F2 = TopoDS::Face(InitOffsetFace.Image(E2).First()); F2 = TopoDS::Face(InitOffsetFace.Image(E2).First());
if (!IsDone(F1,F2)) { if (!IsDone(F1,F2)) {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Intersection tuyau/tuyau si les edges ne sont pas tangentes (AFINIR). // Intersection tube/tube if the edges are not tangent (AFINIR).
//---------------------------------------------------------------------- //----------------------------------------------------------------------
BRepOffset_Tool::PipeInter (F1,F2,LInt1,LInt2,mySide); BRepOffset_Tool::PipeInter (F1,F2,LInt1,LInt2,mySide);
Store (F1,F2,LInt1,LInt2); Store (F1,F2,LInt1,LInt2);
@ -412,9 +409,9 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& SetOfFaces,
} }
else { else {
//------------------------------------------------------- //-------------------------------------------------------
// Intersection du tuyau de E1 avec les faces // // Intersection of the tube of E1 with faces //
// aux face contenant E2 si elles ne sont pas tangentes // to face containing E2 if they are not tangent
// au tuyau. ou si E2 n est pas une edge tangente. // to the tube or if E2 is not a tangent edge.
//------------------------------------------------------- //-------------------------------------------------------
const BRepOffset_ListOfInterval& L = Analyse.Type(E2); const BRepOffset_ListOfInterval& L = Analyse.Type(E2);
if (!L.IsEmpty() && L.First().Type() == BRepOffset_Tangent) { if (!L.IsEmpty() && L.First().Type() == BRepOffset_Tangent) {
@ -485,7 +482,7 @@ void BRepOffset_Inter3d::ConnexIntByInt
if (OT == BRepOffset_Concave) CurSide = TopAbs_IN; if (OT == BRepOffset_Concave) CurSide = TopAbs_IN;
else CurSide = TopAbs_OUT; else CurSide = TopAbs_OUT;
//----------------------------------------------------------- //-----------------------------------------------------------
// l edge est du bon type , recuperation des faces adjacentes. // edge is of the proper type, return adjacent faces.
//----------------------------------------------------------- //-----------------------------------------------------------
const TopTools_ListOfShape& Anc = Analyse.Ancestors(E); const TopTools_ListOfShape& Anc = Analyse.Ancestors(E);
if (Anc.Extent() != 2) continue; if (Anc.Extent() != 2) continue;
@ -517,7 +514,7 @@ void BRepOffset_Inter3d::ConnexIntByInt
BRepOffset_Tool::Inter3D (NF1,NF2,LInt1,LInt2,CurSide,E,Standard_True); BRepOffset_Tool::Inter3D (NF1,NF2,LInt1,LInt2,CurSide,E,Standard_True);
if (LInt1.Extent() > 1) if (LInt1.Extent() > 1)
{ {
// l intersection est en plusieurs edges (franchissement de couture) // intersection is in seceral edges (free sewing)
SelectEdge( NF1, NF2, E, LInt1 ); SelectEdge( NF1, NF2, E, LInt1 );
SelectEdge( NF1, NF2, E, LInt2 ); SelectEdge( NF1, NF2, E, LInt2 );
} }
@ -610,8 +607,8 @@ void BRepOffset_Inter3d::ContextIntByInt
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
if (!Analyse.HasAncestor(E)) { if (!Analyse.HasAncestor(E)) {
//---------------------------------------------------------------- //----------------------------------------------------------------
// Les edges des faces de contexte qui ne sont pas dans le shape // the edges of faces of context that are not in the initial shape
// initiales peuvent apparaitre dans le resultat. // can appear in the result.
//---------------------------------------------------------------- //----------------------------------------------------------------
if (!ExtentContext) { if (!ExtentContext) {
myAsDes->Add(CF,E); myAsDes->Add(CF,E);
@ -753,14 +750,14 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces
continue; continue;
} }
OE.Nullify(); OE.Nullify();
//---------------------------------------------- //---------------------------------------------------
// OF1 face parallele genere par l ancetre de E. // OF1 parallel facee generated by the ancestor of E.
//---------------------------------------------- //---------------------------------------------------
const TopoDS_Shape SI = Analyse.Ancestors(E).First(); const TopoDS_Shape SI = Analyse.Ancestors(E).First();
OF1 = TopoDS::Face(InitOffsetFace.Image(SI).First()); OF1 = TopoDS::Face(InitOffsetFace.Image(SI).First());
OE = TopoDS::Edge(InitOffsetEdge.Image(E).First()); OE = TopoDS::Edge(InitOffsetEdge.Image(E).First());
//-------------------------------------------------- //--------------------------------------------------
// MAJ de OE sur bouchon CF. // MAJ of OE on cap CF.
//-------------------------------------------------- //--------------------------------------------------
// TopTools_ListOfShape LOE; LOE.Append(OE); // TopTools_ListOfShape LOE; LOE.Append(OE);
// BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide); // BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide);
@ -777,7 +774,7 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces
Store(CF,OF1,LInt1,LInt2); Store(CF,OF1,LInt1,LInt2);
//------------------------------------------------------ //------------------------------------------------------
// Traitement des offsets sur les ancetres des vertices. // Processing of offsets on the ancestors of vertices.
//------------------------------------------------------ //------------------------------------------------------
TopoDS_Vertex V[2]; TopoDS_Vertex V[2];
TopExp::Vertices (E,V[0],V[1]); TopExp::Vertices (E,V[0],V[1]);
@ -790,12 +787,12 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces
const TopoDS_Edge& EV = TopoDS::Edge(itLE.Value()); const TopoDS_Edge& EV = TopoDS::Edge(itLE.Value());
if (InitOffsetFace.HasImage(EV)) { if (InitOffsetFace.HasImage(EV)) {
//------------------------------------------------- //-------------------------------------------------
// OF1 face parallele genere par une edge ancetre de V[i]. // OF1 parallel face generated by an ancester edge of V[i].
//------------------------------------------------- //-------------------------------------------------
OF1 = TopoDS::Face(InitOffsetFace.Image(EV).First()); OF1 = TopoDS::Face(InitOffsetFace.Image(EV).First());
OE = TopoDS::Edge(InitOffsetEdge.Image(V[i]).First()); OE = TopoDS::Edge(InitOffsetEdge.Image(V[i]).First());
//-------------------------------------------------- //--------------------------------------------------
// MAj de OE sur bouchon CF. // MAj of OE on cap CF.
//-------------------------------------------------- //--------------------------------------------------
// LOE.Clear(); LOE.Append(OE); // LOE.Clear(); LOE.Append(OE);
// BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide); // BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide);
@ -830,13 +827,12 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces
for ( ; itLF.More(); itLF.Next()) { for ( ; itLF.More(); itLF.Next()) {
const TopoDS_Face& FEV = TopoDS::Face(itLF.Value()); const TopoDS_Face& FEV = TopoDS::Face(itLF.Value());
//------------------------------------------------- //-------------------------------------------------
// OF1 face parallele genere par uneFace ancetre de V[i]. // OF1 parallel face generated by uneFace ancestor of V[i].
//------------------------------------------------- //-------------------------------------------------
OF1 = TopoDS::Face(InitOffsetFace.Image(FEV).First()); OF1 = TopoDS::Face(InitOffsetFace.Image(FEV).First());
if (!IsDone(OF1,CF)) { if (!IsDone(OF1,CF)) {
//------------------------------------------------------- //-------------------------------------------------------
//Recherche si une des edges de OF1 n a pas de trace dans // Find if one of edges of OF1 has no trace in CF.
// CF.
//------------------------------------------------------- //-------------------------------------------------------
TopTools_ListOfShape LOE; TopTools_ListOfShape LOE;
TopExp_Explorer exp2(OF1.Oriented(TopAbs_FORWARD),TopAbs_EDGE); TopExp_Explorer exp2(OF1.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
@ -845,7 +841,7 @@ void BRepOffset_Inter3d::ContextIntByArc(const TopTools_MapOfShape& ContextFaces
} }
BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol); BRepOffset_Tool::TryProject(CF,OF1,LOE,LInt1,LInt2,mySide,myTol);
//------------------------------------------------------- //-------------------------------------------------------
// Si pas de trace essai intersection. // If no trace try intersection.
//------------------------------------------------------- //-------------------------------------------------------
if (LInt1.IsEmpty()) { if (LInt1.IsEmpty()) {
BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge); BRepOffset_Tool::Inter3D (CF,OF1,LInt1,LInt2,mySide,NullEdge);

View File

@ -54,11 +54,11 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
for (; it.More(); it.Next()) { for (; it.More(); it.Next()) {
const TopoDS_Face& F = TopoDS::Face(it.Value()); const TopoDS_Face& F = TopoDS::Face(it.Value());
//--------------------------- //---------------------------
// Initialisation de Loops. // Initialization of Loops.
//--------------------------- //---------------------------
Loops.Init(F); Loops.Init(F);
//----------------------------- //-----------------------------
// recuperation des edges de F. // return edges of F.
//----------------------------- //-----------------------------
const TopTools_ListOfShape& LE = AsDes->Descendant(F); const TopTools_ListOfShape& LE = AsDes->Descendant(F);
TopTools_ListOfShape AddedEdges; TopTools_ListOfShape AddedEdges;
@ -67,10 +67,9 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
TopoDS_Edge E = TopoDS::Edge(itl.Value()); TopoDS_Edge E = TopoDS::Edge(itl.Value());
if (Image.HasImage(E)) { if (Image.HasImage(E)) {
//------------------------------------------- //-------------------------------------------
// E a deja ete decoupeee dans une autre face. // E was already cut in another face.
// Recuperation des edges decoupees et reorientation // Return the cut edges reorientate them as E.
// de ces edges comme E. // See pb for the edges that have disappeared?
// Voir pb pour les edges qui ont disparu?
//------------------------------------------- //-------------------------------------------
const TopTools_ListOfShape& LCE = Image.Image(E); const TopTools_ListOfShape& LCE = Image.Image(E);
for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) { for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) {
@ -84,7 +83,7 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
} }
} }
//------------------------ //------------------------
// Debouclage. // Unwind.
//------------------------ //------------------------
Loops.Perform(); Loops.Perform();
Loops.WiresToFaces(); Loops.WiresToFaces();
@ -93,7 +92,7 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
//------------------------ //------------------------
const TopTools_ListOfShape& NF = Loops.NewFaces(); const TopTools_ListOfShape& NF = Loops.NewFaces();
//----------------------- //-----------------------
// F => Nouvelles faces; // F => New faces;
//----------------------- //-----------------------
Image.Bind(F,NF); Image.Bind(F,NF);
@ -101,7 +100,7 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape& LF,
for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) { for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value()); const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value());
//----------------------- //-----------------------
// E => Nouvelles edges; // E => New edges;
//----------------------- //-----------------------
const TopTools_ListOfShape& LoopNE = Loops.NewEdges(E); const TopTools_ListOfShape& LoopNE = Loops.NewEdges(E);
if (Image.HasImage(E)) { if (Image.HasImage(E)) {
@ -194,7 +193,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
const Standard_Boolean InSide) const Standard_Boolean InSide)
{ {
//----------------------------------------- //-----------------------------------------
// debouclage des bouchons. // unwinding of caps.
//----------------------------------------- //-----------------------------------------
TopTools_ListIteratorOfListOfShape it(LContext); TopTools_ListIteratorOfListOfShape it(LContext);
TopTools_ListIteratorOfListOfShape itl,itLCE; TopTools_ListIteratorOfListOfShape itl,itLCE;
@ -207,16 +206,16 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
const TopoDS_Face& F = TopoDS::Face(it.Value()); const TopoDS_Face& F = TopoDS::Face(it.Value());
TopTools_MapOfShape MBound; TopTools_MapOfShape MBound;
//----------------------------------------------- //-----------------------------------------------
// Initialisation de Loops. // Initialisation of Loops.
// F est reversed elle sera ajoute dans myOffC. // F is reversed it will be added in myOffC.
// et myOffC sera reversed dans le resultat final. // and myOffC will be reversed in the final result.
//----------------------------------------------- //-----------------------------------------------
TopoDS_Shape aLocalShape = F.Reversed(); TopoDS_Shape aLocalShape = F.Reversed();
if (InSide) Loops.Init(TopoDS::Face(aLocalShape)); if (InSide) Loops.Init(TopoDS::Face(aLocalShape));
// if (InSide) Loops.Init(TopoDS::Face(F.Reversed())); // if (InSide) Loops.Init(TopoDS::Face(F.Reversed()));
else Loops.Init(F); else Loops.Init(F);
//-------------------------------------------------------- //--------------------------------------------------------
// recuperation des edges de F non modifie par definition. // return edges of F not modified by definition.
//-------------------------------------------------------- //--------------------------------------------------------
for (exp.Init(F.Oriented(TopAbs_FORWARD),TopAbs_EDGE); for (exp.Init(F.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp.More(); exp.More();
@ -224,7 +223,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
TopoDS_Edge CE = TopoDS::Edge(exp.Current()); TopoDS_Edge CE = TopoDS::Edge(exp.Current());
MBound.Add(CE); MBound.Add(CE);
if (Analyse.HasAncestor(CE)) { if (Analyse.HasAncestor(CE)) {
// les arretes des bouchons sauf les arretes de conexite entre bouchons. // the stop of cups except for the connectivity stops between caps.
// if (!AsDes->HasAscendant(CE)) { // if (!AsDes->HasAscendant(CE)) {
aLocalShape = CE.Reversed(); aLocalShape = CE.Reversed();
if (InSide) Loops.AddConstEdge(CE); if (InSide) Loops.AddConstEdge(CE);
@ -233,7 +232,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
} }
} }
//------------------------------------------------------ //------------------------------------------------------
// Trace des offsets + edge de connexite entre bouchons. // Trace of offsets + connectivity edge between caps.
//------------------------------------------------------ //------------------------------------------------------
const TopTools_ListOfShape& LE = AsDes->Descendant(F); const TopTools_ListOfShape& LE = AsDes->Descendant(F);
TopTools_ListOfShape AddedEdges; TopTools_ListOfShape AddedEdges;
@ -242,10 +241,9 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
TopoDS_Edge E = TopoDS::Edge(itl.Value()); TopoDS_Edge E = TopoDS::Edge(itl.Value());
if (Image.HasImage(E)) { if (Image.HasImage(E)) {
//------------------------------------------- //-------------------------------------------
// E a deja ete decoupeee dans une autre face. // E was already cut in another face.
// Recuperation des edges decoupees et reorientation // Return cut edges and orientate them as E.
// de ces edges comme E. // See pb for the edges that have disappeared?
// Voir pb pour les edges qui ont disparu?
//------------------------------------------- //-------------------------------------------
const TopTools_ListOfShape& LCE = Image.Image(E); const TopTools_ListOfShape& LCE = Image.Image(E);
for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) { for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) {
@ -266,7 +264,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
} }
else { else {
if (IsBetweenCorks(E,AsDes,LContext) && AsDes->HasDescendant(E)) { if (IsBetweenCorks(E,AsDes,LContext) && AsDes->HasDescendant(E)) {
//conexite entre 2 bouchons //connection between 2 caps
MapExtent.Add(E); MapExtent.Add(E);
TopTools_ListOfShape LV; TopTools_ListOfShape LV;
if (InSide) { if (InSide) {
@ -297,7 +295,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
} }
} }
//------------------------ //------------------------
// Debouclage. // Unwind.
//------------------------ //------------------------
Loops.Perform(); Loops.Perform();
Loops.WiresToFaces(); Loops.WiresToFaces();
@ -306,7 +304,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
//------------------------ //------------------------
const TopTools_ListOfShape& NF = Loops.NewFaces(); const TopTools_ListOfShape& NF = Loops.NewFaces();
//----------------------- //-----------------------
// F => Nouvelles faces; // F => New faces;
//----------------------- //-----------------------
Image.Bind(F,NF); Image.Bind(F,NF);
@ -314,7 +312,7 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape& LContext
for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) { for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value()); const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value());
//----------------------- //-----------------------
// E => Nouvelles edges; // E => New edges;
//----------------------- //-----------------------
if (Image.HasImage(E)) { if (Image.HasImage(E)) {
Image.Add(E,Loops.NewEdges(E)); Image.Add(E,Loops.NewEdges(E));
@ -385,7 +383,7 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
BRep_Builder B; BRep_Builder B;
//---------------------------------- //----------------------------------
// Boucle sur toutes les faces //. // Loop on all faces //.
//---------------------------------- //----------------------------------
for (itr.Initialize(LF); itr.More(); itr.Next()) { for (itr.Initialize(LF); itr.More(); itr.Next()) {
TopoDS_Face F = TopoDS::Face(itr.Value()); TopoDS_Face F = TopoDS::Face(itr.Value());
@ -395,14 +393,13 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
if (!Image.HasImage(F)) { if (!Image.HasImage(F)) {
//---------------------------------- //----------------------------------
// Face F non deja reconstruite. // Face F not yet reconstructed.
//---------------------------------- //----------------------------------
const TopTools_ListOfShape& LE = AsDes->Descendant(F); const TopTools_ListOfShape& LE = AsDes->Descendant(F);
//---------------------------------------------------------------- //----------------------------------------------------------------
// premiere boucle pour determiner si des edges de la face ont ete // first loop to find if the edges of the face were reconstructed.
// reconstruite. // - maj on map MONV. Some vertices on reconstructed edges
// - maj de la map MONV. certains vertex sur les edges reconstruites // coincide geometrically with old but are not IsSame.
// coincide geometriquement avec les anciens mais ne sont pas IsSame.
//---------------------------------------------------------------- //----------------------------------------------------------------
TopTools_DataMapOfShapeShape MONV; TopTools_DataMapOfShapeShape MONV;
TopoDS_Vertex OV1,OV2,NV1,NV2; TopoDS_Vertex OV1,OV2,NV1,NV2;
@ -419,7 +416,7 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
continue; continue;
} }
//---------------------------------- //----------------------------------
// F doit etre reconstruite. // F should be reconstructed.
//---------------------------------- //----------------------------------
ToRebuild = Standard_True; ToRebuild = Standard_True;
for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) { for (itLCE.Initialize(LCE); itLCE.More(); itLCE.Next()) {
@ -436,7 +433,7 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
} }
if (ToRebuild) { if (ToRebuild) {
#ifdef DRAW #ifdef DRAW
//POP pour NT //POP for NT
if ( Affich) { if ( Affich) {
char* name = new char[100]; char* name = new char[100];
sprintf(name,"CF_%d",NbF++); sprintf(name,"CF_%d",NbF++);
@ -445,9 +442,8 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
#endif #endif
//----------------------------------------------------------- //-----------------------------------------------------------
// les edges non reconstruites dans d autre faces sont // Non-reconstructed edges on other faces are added.
// ajoutees .si leurs vertex ont ete reconstruits elles // If their vertices were reconstructed they are reconstructed.
// seront reconstruites.
//----------------------------------------------------------- //-----------------------------------------------------------
for (itl.Initialize(LE); itl.More(); itl.Next()) { for (itl.Initialize(LE); itl.More(); itl.Next()) {
Standard_Real f,l; Standard_Real f,l;
@ -494,7 +490,7 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
//------------------------ //------------------------
const TopTools_ListOfShape& NF = Loops.NewFaces(); const TopTools_ListOfShape& NF = Loops.NewFaces();
//----------------------- //-----------------------
// F => Nouvelles faces; // F => New faces;
//----------------------- //-----------------------
Image.Bind(F,NF); Image.Bind(F,NF);
@ -502,7 +498,7 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape& LF,
for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) { for (itAdded.Initialize(AddedEdges); itAdded.More(); itAdded.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value()); const TopoDS_Edge& E = TopoDS::Edge(itAdded.Value());
//----------------------- //-----------------------
// E => Nouvelles edges; // E => New edges;
//----------------------- //-----------------------
if (Image.HasImage(E)) { if (Image.HasImage(E)) {
Image.Add(E,Loops.NewEdges(E)); Image.Add(E,Loops.NewEdges(E));

View File

@ -101,7 +101,7 @@
#include <GeomFill_Generator.hxx> #include <GeomFill_Generator.hxx>
// POP pour NT // POP for NT
#include <stdio.h> #include <stdio.h>
#ifdef DRAW #ifdef DRAW
@ -145,7 +145,7 @@ static void DEBVerticesControl (const TopTools_MapOfShape& NewEdges,
for (it1LE.Initialize(AsDes->Descendant(NE)); it1LE.More(); it1LE.Next()) { for (it1LE.Initialize(AsDes->Descendant(NE)); it1LE.More(); it1LE.Next()) {
if (AsDes->Ascendant(it1LE.Value()).Extent() < 3) { if (AsDes->Ascendant(it1LE.Value()).Extent() < 3) {
LVP.Append(it1LE.Value()); LVP.Append(it1LE.Value());
cout <<"Vertex sur moins de 3 edges."<<endl; cout <<"Vertex on at least 3 edges."<<endl;
#ifdef DRAW #ifdef DRAW
if (AffichInt2d) { if (AffichInt2d) {
sprintf (name,"VP_%d",NVP++); sprintf (name,"VP_%d",NVP++);
@ -154,7 +154,7 @@ static void DEBVerticesControl (const TopTools_MapOfShape& NewEdges,
#endif #endif
} }
else if (AsDes->Ascendant(it1LE.Value()).Extent() > 3) { else if (AsDes->Ascendant(it1LE.Value()).Extent() > 3) {
cout <<"Vertex sur plus de 3 edges."<<endl; cout <<"Vertex on more than 3 edges."<<endl;
#ifdef DRAW #ifdef DRAW
if (AffichInt2d) { if (AffichInt2d) {
sprintf (name,"VM_%d",NVM++); sprintf (name,"VM_%d",NVM++);
@ -175,7 +175,7 @@ static void DEBVerticesControl (const TopTools_MapOfShape& NewEdges,
} }
} }
//------------------------------------------------ //------------------------------------------------
// Essai de confusion des vertex pourris. // Try to mix spoiled vertices.
//------------------------------------------------ //------------------------------------------------
BRep_Builder B; BRep_Builder B;
TopTools_ListIteratorOfListOfShape it1(LVP); TopTools_ListIteratorOfListOfShape it1(LVP);
@ -220,7 +220,7 @@ static void DEBVerticesControl (const TopTools_MapOfShape& NewEdges,
j++; j++;
} }
i++; i++;
cout <<" distmin entre VP : "<<distmin<<endl; cout <<" distmin between VP : "<<distmin<<endl;
} }
} }
#endif #endif
@ -570,8 +570,8 @@ static void RemoveCorks (TopoDS_Shape& S,
BRep_Builder B; BRep_Builder B;
B.MakeCompound (SS); B.MakeCompound (SS);
//----------------------------------------------------- //-----------------------------------------------------
// Construction d un shape sans les bouchons. // Construction of a shape without caps.
// et Orientation des bouchons comme dans le shape S. // and Orientation of caps as in shape S.
//----------------------------------------------------- //-----------------------------------------------------
TopExp_Explorer exp(S,TopAbs_FACE); TopExp_Explorer exp(S,TopAbs_FACE);
for (; exp.More(); exp.Next()) { for (; exp.More(); exp.Next()) {
@ -581,7 +581,7 @@ static void RemoveCorks (TopoDS_Shape& S,
} }
else { else {
Faces.Remove (Cork); Faces.Remove (Cork);
Faces.Add (Cork); // pour la remettre avec la bonne orientation. Faces.Add (Cork); // to reset it with proper orientation.
} }
} }
S = SS; S = SS;
@ -650,7 +650,7 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
{ {
myDone = Standard_False; myDone = Standard_False;
//------------------------------------------ //------------------------------------------
// Constuction de myShape sans les bouchons. // Construction of myShape without caps.
//------------------------------------------ //------------------------------------------
RemoveCorks (myShape,myFaces); RemoveCorks (myShape,myFaces);
@ -671,10 +671,10 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
Standard_Real TolAngle = 4*ASin(myTol/Abs(myOffset*0.5)); Standard_Real TolAngle = 4*ASin(myTol/Abs(myOffset*0.5));
myAnalyse.Perform(myShape,TolAngle); myAnalyse.Perform(myShape,TolAngle);
//--------------------------------------------------- //---------------------------------------------------
// Construction des Offset a partir de la preanalyse. // Construction of Offset from preanalysis.
//--------------------------------------------------- //---------------------------------------------------
//---------------------------- //----------------------------
// MaJ de la SD Face - Offset // MaJ of SD Face - Offset
//---------------------------- //----------------------------
UpdateFaceOffset(); UpdateFaceOffset();
@ -683,7 +683,7 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
else if (myJoin == GeomAbs_Intersection) else if (myJoin == GeomAbs_Intersection)
BuildOffsetByInter(); BuildOffsetByInter();
//----------------- //-----------------
// Auto debouclage. // Auto unwinding.
//----------------- //-----------------
// if (mySelfInter) SelfInter(Modif); // if (mySelfInter) SelfInter(Modif);
//----------------- //-----------------
@ -699,12 +699,12 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
if (!Modif.IsEmpty()) Intersection2D (Modif,NewEdges); if (!Modif.IsEmpty()) Intersection2D (Modif,NewEdges);
//------------------------------------------------------- //-------------------------------------------------------
// Debouclage 2D et reconstruction des faces modifiees // Unwinding 2D and reconstruction of modified faces
//---------------------------------------------------- //----------------------------------------------------
MakeLoops (Modif); MakeLoops (Modif);
//----------------------------------------------------- //-----------------------------------------------------
// Reconstuction des faces non modifie mais qui partage // Reconstruction of non modified faces sharing
// des edges recontruits // reconstructed edges
//------------------------------------------------------ //------------------------------------------------------
if (!Modif.IsEmpty()) MakeFaces (Modif); if (!Modif.IsEmpty()) MakeFaces (Modif);
@ -712,24 +712,24 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
MakeMissingWalls(); MakeMissingWalls();
//------------------------- //-------------------------
// Construction des shells. // Construction of shells.
//------------------------- //-------------------------
MakeShells (); MakeShells ();
//-------------- //--------------
// Debouclage3d. // Unwinding 3D.
//-------------- //--------------
SelectShells (); SelectShells ();
//---------------------------------- //----------------------------------
// Codage ges regularites. // Coding of regularities.
//---------------------------------- //----------------------------------
EncodeRegularity(); EncodeRegularity();
//---------------------- //----------------------
// Creation des solides. // Creation of solids.
//---------------------- //----------------------
MakeSolid (); MakeSolid ();
//----------------------------- //-----------------------------
// MAJ Tolerance edge et Vertex // MAJ Tolerance edge and Vertex
// ---------------------------- // ----------------------------
if (!myOffsetShape.IsNull()) { if (!myOffsetShape.IsNull()) {
UpdateTolerance (myOffsetShape,myFaces); UpdateTolerance (myOffsetShape,myFaces);
@ -751,13 +751,13 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
void BRepOffset_MakeOffset::MakeThickSolid() void BRepOffset_MakeOffset::MakeThickSolid()
{ {
//-------------------------------------------------------------- //--------------------------------------------------------------
// Construction shell parallele au shell (initial sans bouchon). // Construction of shell parallel to shell (initial without cap).
//-------------------------------------------------------------- //--------------------------------------------------------------
MakeOffsetShape (); MakeOffsetShape ();
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Construction d un solide avec le shell initial le shell parallele // Construction of a solid with the initial shell, parallel shell
// limite par les bouchons. // limited by caps.
//-------------------------------------------------------------------- //--------------------------------------------------------------------
if (!myFaces.IsEmpty()) { if (!myFaces.IsEmpty()) {
TopoDS_Solid Res; TopoDS_Solid Res;
@ -790,8 +790,8 @@ void BRepOffset_MakeOffset::MakeThickSolid()
Res.Closed(Standard_True); Res.Closed(Standard_True);
myOffsetShape = Res; myOffsetShape = Res;
// Test de Validite du resultat le Solide epais doit avoir // Test of Validity of the result of thick Solid
// plus de face que le solide initial. // more face than the initial solid.
Standard_Integer NbOF = 0; Standard_Integer NbOF = 0;
for (exp.Init(myOffsetShape,TopAbs_FACE);exp.More(); exp.Next()) { for (exp.Init(myOffsetShape,TopAbs_FACE);exp.More(); exp.Next()) {
@ -840,8 +840,8 @@ const TopoDS_Shape& BRepOffset_MakeOffset::Shape() const
//======================================================================= //=======================================================================
//function : TrimEdge //function : TrimEdge
//purpose : Trim l edge au plus large par ses descendants dans AsDes2d. //purpose : Trim the edge of the largest of descendants in AsDes2d.
// Range dans AsDes les deux vertex qui ont trimme l edge. // Order in AsDes two vertices that have trimmed the edge.
//======================================================================= //=======================================================================
static void TrimEdge (TopoDS_Edge& NE, static void TrimEdge (TopoDS_Edge& NE,
@ -912,7 +912,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
{ {
#ifdef DEB #ifdef DEB
if ( ChronBuild) { if ( ChronBuild) {
cout << " CONSTRUCTION DES OFFSETS :" << endl; cout << " CONSTRUCTION OF OFFSETS :" << endl;
Clock.Reset(); Clock.Reset();
Clock.Start(); Clock.Start();
} }
@ -922,7 +922,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
TopTools_MapOfShape Done; TopTools_MapOfShape Done;
Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False; Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False;
//-------------------------------------------------------- //--------------------------------------------------------
// Construction des faces paralleles a des faces initiales // Construction of faces parallel to initial faces
//-------------------------------------------------------- //--------------------------------------------------------
TopExp_Explorer Exp; TopExp_Explorer Exp;
TopTools_ListOfShape LF; TopTools_ListOfShape LF;
@ -980,20 +980,20 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
Handle(BRepAlgo_AsDes) AsDes = new BRepAlgo_AsDes(); Handle(BRepAlgo_AsDes) AsDes = new BRepAlgo_AsDes();
//------------------------------------------------------------------- //-------------------------------------------------------------------
// Extension des faces et calcul des nouvelles edges d intersection. // Extension of faces and calculation of new edges of intersection.
//------------------------------------------------------------------- //-------------------------------------------------------------------
Standard_Boolean ExtentContext = 0; Standard_Boolean ExtentContext = 0;
if (myOffset > 0) ExtentContext = 1; if (myOffset > 0) ExtentContext = 1;
BRepOffset_Inter3d Inter3 (AsDes,Side,myTol); BRepOffset_Inter3d Inter3 (AsDes,Side,myTol);
// Intersection entre faces paralleles // Intersection between parallel faces
Inter3.ConnexIntByInt(myShape,MapSF,myAnalyse,MES,Build,Failed ); Inter3.ConnexIntByInt(myShape,MapSF,myAnalyse,MES,Build,Failed );
// Intersection avec les bouchons. // Intersection with caps.
Inter3.ContextIntByInt(myFaces,ExtentContext,MapSF,myAnalyse,MES,Build,Failed ); Inter3.ContextIntByInt(myFaces,ExtentContext,MapSF,myAnalyse,MES,Build,Failed );
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
// Extension des edges voisines des nouvelles edges.et intersection entre les voisins. // Extension of neighbor edges of new edges and intersection between neighbors.
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes(); Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) { for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
@ -1004,7 +1004,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
// Modified by skv - Mon Jan 12 11:50:03 2004 OCC4455 End // Modified by skv - Mon Jan 12 11:50:03 2004 OCC4455 End
} }
//----------------------------------------------------------- //-----------------------------------------------------------
// Restriction large des nouvelles edges et mise a jour AsDes. // Great restriction of new edges and update of AsDes.
//------------------------------------------ ---------------- //------------------------------------------ ----------------
TopTools_MapOfShape NewEdges; TopTools_MapOfShape NewEdges;
TopExp_Explorer Exp2,ExpC; TopExp_Explorer Exp2,ExpC;
@ -1030,9 +1030,9 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
} }
else { else {
//------------------------------------------------------------ //------------------------------------------------------------
// Les Intersections sont en plusieurs edges. // The Intersections are on several edges.
// Les morceaux sans intersections avec les voisins // The pieces without intersections with neighbors
// sont supprimes de AsDes. // are removed from AsDes.
//------------------------------------------------------------ //------------------------------------------------------------
for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) { for (ExpC.Init(NE,TopAbs_EDGE); ExpC.More(); ExpC.Next()) {
if (NewEdges.Add(ExpC.Current())) { if (NewEdges.Add(ExpC.Current())) {
@ -1065,7 +1065,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
} }
//--------------------------------- //---------------------------------
// Intersection2d sur les // // Intersection 2D on //
//--------------------------------- //---------------------------------
TopTools_ListOfShape LFE; TopTools_ListOfShape LFE;
BRepAlgo_Image IMOE; BRepAlgo_Image IMOE;
@ -1085,7 +1085,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
BRepOffset_Inter2d::Compute(AsDes,NEF,NewEdges,myTol); BRepOffset_Inter2d::Compute(AsDes,NEF,NewEdges,myTol);
} }
//---------------------------------------------- //----------------------------------------------
// Intersections 2d sur les bouchons. // Intersections 2d on caps.
//---------------------------------------------- //----------------------------------------------
TopTools_MapIteratorOfMapOfShape itCork(myFaces); TopTools_MapIteratorOfMapOfShape itCork(myFaces);
for (; itCork.More(); itCork.Next()) { for (; itCork.More(); itCork.Next()) {
@ -1094,7 +1094,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
} }
//------------------------------- //-------------------------------
// Debouclage des Faces etendues. // Unwinding of extended Faces.
//------------------------------- //-------------------------------
myMakeLoops.Build(LFE ,AsDes,IMOE); myMakeLoops.Build(LFE ,AsDes,IMOE);
@ -1102,7 +1102,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
TopTools_MapOfShape COES; TopTools_MapOfShape COES;
#endif #endif
//--------------------------- //---------------------------
// MAJ SD. pour les faces // // MAJ SD. for faces //
//--------------------------- //---------------------------
for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) { for (Exp.Init(myShape,TopAbs_FACE) ; Exp.More(); Exp.Next()) {
const TopoDS_Shape& FI = Exp.Current(); const TopoDS_Shape& FI = Exp.Current();
@ -1288,7 +1288,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
// Modified by skv - Tue Mar 15 16:20:43 2005 // Modified by skv - Tue Mar 15 16:20:43 2005
//--------------------------- //---------------------------
// MAJ SD. pour les bouchons // MAJ SD. for caps
//--------------------------- //---------------------------
TopTools_MapOfShape View; TopTools_MapOfShape View;
for (itCork.Initialize(myFaces); itCork.More(); itCork.Next()) { for (itCork.Initialize(myFaces); itCork.More(); itCork.Next()) {
@ -1349,7 +1349,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
{ {
#ifdef DEB #ifdef DEB
if ( ChronBuild) { if ( ChronBuild) {
cout << " CONSTRUCTION DES OFFSETS :" << endl; cout << " CONSTRUCTION OF OFFSETS :" << endl;
Clock.Reset(); Clock.Reset();
Clock.Start(); Clock.Start();
} }
@ -1359,7 +1359,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
TopTools_MapOfShape Done; TopTools_MapOfShape Done;
Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False; Standard_Boolean OffsetOutside = (myOffset > 0.)? Standard_True : Standard_False;
//-------------------------------------------------------- //--------------------------------------------------------
// Construction des faces paralleles a des faces initiales // Construction of faces parallel to initial faces
//-------------------------------------------------------- //--------------------------------------------------------
TopExp_Explorer Exp; TopExp_Explorer Exp;
TopTools_ListOfShape LF; TopTools_ListOfShape LF;
@ -1406,7 +1406,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
MapSF.Bind(F,OF); MapSF.Bind(F,OF);
} }
//-------------------------------------------------------- //--------------------------------------------------------
// Construction des tuyaux sur arete. // Construction of tubes on edge.
//-------------------------------------------------------- //--------------------------------------------------------
BRepOffset_Type OT = BRepOffset_Convex; BRepOffset_Type OT = BRepOffset_Convex;
if (myOffset < 0.) OT = BRepOffset_Concave; if (myOffset < 0.) OT = BRepOffset_Concave;
@ -1463,7 +1463,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
} }
else { else {
// ---------------------- // ----------------------
// bord libre. // free border.
// ---------------------- // ----------------------
TopoDS_Shape aLocalShape = MapSF(Anc.First()).Generated(E); TopoDS_Shape aLocalShape = MapSF(Anc.First()).Generated(E);
TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShape); TopoDS_Edge EOn1 = TopoDS::Edge(aLocalShape);
@ -1475,7 +1475,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
} }
//-------------------------------------------------------- //--------------------------------------------------------
// Construction des shperes sur vertex. // Construction of spheres on vertex.
//-------------------------------------------------------- //--------------------------------------------------------
Done.Clear(); Done.Clear();
TopTools_ListIteratorOfListOfShape it; TopTools_ListIteratorOfListOfShape it;
@ -1490,7 +1490,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
if (LE.Extent() >= 3 && LE.Extent() == LA.Extent()) { if (LE.Extent() >= 3 && LE.Extent() == LA.Extent()) {
TopTools_ListOfShape LOE; TopTools_ListOfShape LOE;
//-------------------------------------------------------- //--------------------------------------------------------
// Recuperation des edges connexes sur les tuyaux. // Return connected edges on tubes.
//-------------------------------------------------------- //--------------------------------------------------------
for (it.Initialize(LE) ; it.More(); it.Next()) { for (it.Initialize(LE) ; it.More(); it.Next()) {
LOE.Append(MapSF(it.Value()).Generated(V).Reversed()); LOE.Append(MapSF(it.Value()).Generated(V).Reversed());
@ -1508,7 +1508,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
MapSF.Bind(V,OF); MapSF.Bind(V,OF);
} }
//-------------------------------------------------------------- //--------------------------------------------------------------
// Traitemnet particulier si V est sur au moins un bord libre. // Particular processing if V is at least a free border.
//------------------------------------------------------------- //-------------------------------------------------------------
TopTools_ListOfShape LBF; TopTools_ListOfShape LBF;
myAnalyse.Edges(V,BRepOffset_FreeBoundary,LBF); myAnalyse.Edges(V,BRepOffset_FreeBoundary,LBF);
@ -1529,8 +1529,8 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
} }
//------------------------------------------------------------ //------------------------------------------------------------
// Extension des faces paralleles jusq au contexte. // Extension of parallel faces to the context.
// Les faces etendues sont rangees en SD et Supprime de MapSF. // Extended faces are ordered in DS and removed from MapSF.
//------------------------------------------------------------ //------------------------------------------------------------
if (!myFaces.IsEmpty()) ToContext (MapSF); if (!myFaces.IsEmpty()) ToContext (MapSF);
@ -1549,8 +1549,7 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
if (SF.Status() == BRepOffset_Reversed || if (SF.Status() == BRepOffset_Reversed ||
SF.Status() == BRepOffset_Degenerated ) { SF.Status() == BRepOffset_Degenerated ) {
//------------------------------------------------ //------------------------------------------------
// Les faces degenerees ou retournees ne sont pas // Degenerated or returned faces are not stored.
// stockes.
//------------------------------------------------ //------------------------------------------------
continue; continue;
} }
@ -1558,15 +1557,15 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
const TopoDS_Face& OF = It.Value().Face(); const TopoDS_Face& OF = It.Value().Face();
myInitOffsetFace.Bind (SI,OF); myInitOffsetFace.Bind (SI,OF);
myInitOffsetFace.SetRoot (SI); // Initial<-> Offset myInitOffsetFace.SetRoot (SI); // Initial<-> Offset
myImageOffset.SetRoot (OF); // FaceOffset racine des images myImageOffset.SetRoot (OF); // FaceOffset root of images
if (SI.ShapeType() == TopAbs_FACE) { if (SI.ShapeType() == TopAbs_FACE) {
for (Exp.Init(SI.Oriented(TopAbs_FORWARD),TopAbs_EDGE); for (Exp.Init(SI.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
Exp.More(); Exp.Next()) { Exp.More(); Exp.Next()) {
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// A chaque face // on associe les edges qui la restreignent // To each face are associatedthe edges that restrict that
// Les edges qui ne genere pas de tuyaux ou qui ne sont pas tangentes // The edges that do not generate tubes or are not tangent
// a deux faces sont supprimees. // to two faces are removed.
//-------------------------------------------------------------------- //--------------------------------------------------------------------
const TopoDS_Edge& E = TopoDS::Edge(Exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
const BRepOffset_ListOfInterval& L = myAnalyse.Type(E); const BRepOffset_ListOfInterval& L = myAnalyse.Type(E);
@ -1643,15 +1642,15 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
if (!myAnalyse.HasAncestor(E)) { if (!myAnalyse.HasAncestor(E)) {
//---------------------------------------------------------------- //----------------------------------------------------------------
// Les edges des faces de contexte qui ne sont pas dans le shape // The edges of context faces that are not in the initial shape
// initiales peuvent apparaitre dans le resultat. // can appear in the result.
//---------------------------------------------------------------- //----------------------------------------------------------------
//myAsDes->Add(CF,E); //myAsDes->Add(CF,E);
} }
} }
} }
//-------------------------------------------------------- //-------------------------------------------------------
// Determination des edges et des faces a reconstruire par // Determine the edges and faces reconstructed by
// intersection. // intersection.
//--------------------------------------------------------- //---------------------------------------------------------
for ( it.Initialize(myFaces); it.More(); it.Next()) { for ( it.Initialize(myFaces); it.More(); it.Next()) {
@ -1683,7 +1682,7 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
} }
} }
//--------------------------- //---------------------------
// Reconstruction des faces. // Reconstruction of faces.
//--------------------------- //---------------------------
TopoDS_Face F,NF; TopoDS_Face F,NF;
BRepOffset_Type RT = BRepOffset_Concave; BRepOffset_Type RT = BRepOffset_Concave;
@ -1731,7 +1730,7 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
} }
else { else {
//------------------ //------------------
// Tuyau // Tube
//--------------------- //---------------------
for (exp.Init(NF.Oriented(TopAbs_FORWARD),TopAbs_EDGE); for (exp.Init(NF.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
exp.More(); exp.Next()) { exp.More(); exp.Next()) {
@ -1741,9 +1740,9 @@ void BRepOffset_MakeOffset::ToContext (BRepOffset_DataMapOfShapeOffset& MapSF)
MapSF.UnBind(S); MapSF.UnBind(S);
} }
//---------------- //------------------
// MAJ bords libre // MAJ free borders
//---------------- //------------------
TopTools_DataMapIteratorOfDataMapOfShapeShape itc; TopTools_DataMapIteratorOfDataMapOfShapeShape itc;
for (itc.Initialize(Created); itc.More(); itc.Next()) { for (itc.Initialize(Created); itc.More(); itc.Next()) {
OE = itc.Key(); OE = itc.Key();
@ -1838,7 +1837,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
//Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &anEdge.TShape()); //Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &anEdge.TShape());
if (BRep_Tool::Degenerated(anEdge)) if (BRep_Tool::Degenerated(anEdge))
{ {
//Check wether anEdge is a really degenerated edge or not //Check if anEdge is a really degenerated edge or not
BRepAdaptor_Curve BACurve(anEdge, aFace); BRepAdaptor_Curve BACurve(anEdge, aFace);
gp_Pnt Pfirst, Plast, Pmid; gp_Pnt Pfirst, Plast, Pmid;
Pfirst = BACurve.Value(BACurve.FirstParameter()); Pfirst = BACurve.Value(BACurve.FirstParameter());
@ -2550,20 +2549,20 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
Clock.Start(); Clock.Start();
} }
#endif #endif
TopTools_ListOfShape OffsetFaces; // liste des faces // crees. TopTools_ListOfShape OffsetFaces; // list of faces // created.
MakeList (OffsetFaces,myInitOffsetFace,myFaces); MakeList (OffsetFaces,myInitOffsetFace,myFaces);
if (!myFaces.IsEmpty()) { if (!myFaces.IsEmpty()) {
Standard_Boolean InSide = (myOffset < 0.); // PROVISOIRE Standard_Boolean InSide = (myOffset < 0.); // Temporary
// il faut calculer Inside en tenant compte de la concavite ou convexite des arretes // it is necessary to calculate Inside taking account of the concavity or convexity of edges
// entre le bouchon et la piece. // between the cap and the part.
if (myJoin == GeomAbs_Arc) if (myJoin == GeomAbs_Arc)
Inter.ContextIntByArc (myFaces,InSide,myAnalyse,myInitOffsetFace,myInitOffsetEdge); Inter.ContextIntByArc (myFaces,InSide,myAnalyse,myInitOffsetFace,myInitOffsetEdge);
} }
if (myInter) { if (myInter) {
//------------- //-------------
//Complet. //Complete.
//------------- //-------------
Inter.CompletInt (OffsetFaces,myInitOffsetFace); Inter.CompletInt (OffsetFaces,myInitOffsetFace);
TopTools_MapOfShape& NewEdges = Inter.NewEdges(); TopTools_MapOfShape& NewEdges = Inter.NewEdges();
@ -2573,7 +2572,7 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
} }
else { else {
//-------------------------------- //--------------------------------
// Seulememt entre face voisines. // Only between neighbor faces.
//-------------------------------- //--------------------------------
Inter.ConnexIntByArc(OffsetFaces,myShape,myAnalyse,myInitOffsetFace); Inter.ConnexIntByArc(OffsetFaces,myShape,myAnalyse,myInitOffsetFace);
} }
@ -2597,13 +2596,13 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_MapOfShape& Modif,
Clock.Start(); Clock.Start();
} }
#endif #endif
//----------------------------------------------------------- //--------------------------------------------------------
// calcul des intersections2d sur les faces touchees par les // calculate intersections2d on faces concerned by
// intersection3d // intersection3d
//--------------------------------------------------------- //--------------------------------------------------------
TopTools_MapIteratorOfMapOfShape it(Modif); TopTools_MapIteratorOfMapOfShape it(Modif);
//----------------------------------------------- //-----------------------------------------------
// Intersection des edges 2 a 2. // Intersection of edges 2 by 2.
//----------------------------------------------- //-----------------------------------------------
for ( it.Initialize(Modif); it.More(); it.Next()) { for ( it.Initialize(Modif); it.More(); it.Next()) {
const TopoDS_Face& F = TopoDS::Face(it.Key()); const TopoDS_Face& F = TopoDS::Face(it.Key());
@ -2636,7 +2635,7 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_MapOfShape& Modif)
TopTools_MapIteratorOfMapOfShape it(Modif); TopTools_MapIteratorOfMapOfShape it(Modif);
TopTools_ListOfShape LF,LC; TopTools_ListOfShape LF,LC;
//----------------------------------------- //-----------------------------------------
// debouclage des faces // modifiees. // unwinding of faces // modified.
//----------------------------------------- //-----------------------------------------
for (; it.More(); it.Next()) { for (; it.More(); it.Next()) {
if (!myFaces.Contains(it.Key())) LF.Append(it.Key()); if (!myFaces.Contains(it.Key())) LF.Append(it.Key());
@ -2644,7 +2643,7 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_MapOfShape& Modif)
myMakeLoops.Build(LF,myAsDes,myImageOffset); myMakeLoops.Build(LF,myAsDes,myImageOffset);
//----------------------------------------- //-----------------------------------------
// debouclage des bouchons. // unwinding of caps.
//----------------------------------------- //-----------------------------------------
for (it.Initialize(myFaces); it.More(); it.Next()) { for (it.Initialize(myFaces); it.More(); it.Next()) {
LC.Append(it.Key()); LC.Append(it.Key());
@ -2660,15 +2659,15 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_MapOfShape& Modif)
//======================================================================= //=======================================================================
//function : MakeFaces //function : MakeFaces
//purpose : Reconstruction des faces topologiquement inchangees qui //purpose : Reconstruction of topologically unchanged faces that
// partage des edges qui ont ete reconstruites. // share edges that were reconstructed.
//======================================================================= //=======================================================================
void BRepOffset_MakeOffset::MakeFaces(TopTools_MapOfShape& Modif) void BRepOffset_MakeOffset::MakeFaces(TopTools_MapOfShape& Modif)
{ {
#ifdef DEb #ifdef DEb
if (ChronBuild) { if (ChronBuild) {
cout << " RECONSTRUCTION DES FACES:" << endl; cout << " RECONSTRUCTION OF FACES:" << endl;
Clock.Reset(); Clock.Reset();
Clock.Start(); Clock.Start();
} }
@ -2677,7 +2676,7 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_MapOfShape& Modif)
const TopTools_ListOfShape& Roots = myInitOffsetFace.Roots(); const TopTools_ListOfShape& Roots = myInitOffsetFace.Roots();
TopTools_ListOfShape LOF; TopTools_ListOfShape LOF;
//---------------------------------- //----------------------------------
// Boucle sur toutes les faces //. // Loop on all faces //.
//---------------------------------- //----------------------------------
for (itr.Initialize(Roots); itr.More(); itr.Next()) { for (itr.Initialize(Roots); itr.More(); itr.Next()) {
TopoDS_Face F = TopoDS::Face(myInitOffsetFace.Image(itr.Value()).First()); TopoDS_Face F = TopoDS::Face(myInitOffsetFace.Image(itr.Value()).First());
@ -2692,7 +2691,7 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_MapOfShape& Modif)
//======================================================================= //=======================================================================
//function : UpdateInitOffset //function : UpdateInitOffset
//purpose : mis a jour et purge de myInitOffset //purpose : Update and cleaning of myInitOffset
//======================================================================= //=======================================================================
static void UpdateInitOffset (BRepAlgo_Image& myInitOffset, static void UpdateInitOffset (BRepAlgo_Image& myInitOffset,
@ -3059,7 +3058,7 @@ void BRepOffset_MakeOffset::MakeShells ()
{ {
#ifdef DEB #ifdef DEB
if (ChronBuild) { if (ChronBuild) {
cout << " RECONSTRUCTION DES SHELLS:" << endl; cout << " RECONSTRUCTION OF SHELLS:" << endl;
Clock.Reset(); Clock.Reset();
Clock.Start(); Clock.Start();
} }
@ -3143,9 +3142,9 @@ void BRepOffset_MakeOffset::SelectShells ()
TopTools_MapOfShape FreeEdges; TopTools_MapOfShape FreeEdges;
TopExp_Explorer exp(myShape,TopAbs_EDGE); TopExp_Explorer exp(myShape,TopAbs_EDGE);
//------------------------------------------------------------- //-------------------------------------------------------------
// FreeEdges ensemble des edges qui peuvent etre bord libre dans // FreeEdges all edges that can have free border in the
// le shell parallele // parallel shell
// 1 - les bord libres de myShape . // 1 - free borders of myShape .
//------------------------------------------------------------- //-------------------------------------------------------------
for ( ; exp.More(); exp.Next()) { for ( ; exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
@ -3156,8 +3155,8 @@ void BRepOffset_MakeOffset::SelectShells ()
} }
} }
} }
// myShape a des bords libres et il n y a pas de bouchons. // myShape has free borders and there are no caps
// pas de debouclage3d. // no unwinding 3d.
if (!FreeEdges.IsEmpty() && myFaces.IsEmpty()) return; if (!FreeEdges.IsEmpty() && myFaces.IsEmpty()) return;
myOffsetShape = BRepOffset_Tool::Deboucle3D(myOffsetShape,FreeEdges); myOffsetShape = BRepOffset_Tool::Deboucle3D(myOffsetShape,FreeEdges);
@ -3218,14 +3217,14 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
{ {
#ifdef DEB #ifdef DEB
if (ChronBuild) { if (ChronBuild) {
cout << " CODAGE DES REGULARITES:" << endl; cout << " CODING OF REGULARITIES:" << endl;
Clock.Reset(); Clock.Reset();
Clock.Start(); Clock.Start();
} }
#endif #endif
if (myOffsetShape.IsNull()) return; if (myOffsetShape.IsNull()) return;
// recherche des edges G1 dans le resultat // find edges G1 in the result
TopExp_Explorer exp(myOffsetShape,TopAbs_EDGE); TopExp_Explorer exp(myOffsetShape,TopAbs_EDGE);
BRep_Builder B; BRep_Builder B;
@ -3246,7 +3245,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
if (LofOF.Extent() != 2) { if (LofOF.Extent() != 2) {
#ifdef DEB #ifdef DEB
if ( Standard_False) if ( Standard_False)
cout << " Edge partage par " << LofOF.Extent() << " Faces" << endl; cout << " Edge shared by " << LofOF.Extent() << " Faces" << endl;
#endif #endif
continue; continue;
} }
@ -3265,12 +3264,12 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
if (F1.IsSame(F2)) { if (F1.IsSame(F2)) {
if (BRep_Tool::IsClosed(OE,F1)) { if (BRep_Tool::IsClosed(OE,F1)) {
// Debug provisoire pour le Bench. // Temporary Debug for the Bench.
// Voir avec YFR. // Check with YFR.
// En mode intersection, les aretes ne sont pas codees dans myInitOffsetEdge // In mode intersection, the edges are not coded in myInitOffsetEdge
// on gere donc au cas par cas. // so, manage case by case
// Remarque DUB; Pour les parties cachees, il FAUT coder CN // Note DUB; for Hidden parts, it is NECESSARY to code CN
// les Surf Analytiques. // Analytic Surfaces.
if (myJoin == GeomAbs_Intersection) { if (myJoin == GeomAbs_Intersection) {
BRepAdaptor_Surface BS(F1,Standard_False); BRepAdaptor_Surface BS(F1,Standard_False);
GeomAbs_SurfaceType SType = BS.GetType(); GeomAbs_SurfaceType SType = BS.GetType();
@ -3281,7 +3280,7 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
B.Continuity(OE,F1,F1,GeomAbs_CN); B.Continuity(OE,F1,F1,GeomAbs_CN);
} }
else { else {
// Voir YFR : MaJ de myInitOffsetFace // See YFR : MaJ of myInitOffsetFace
} }
} }
else if (myInitOffsetEdge.IsImage(ROE)) { else if (myInitOffsetEdge.IsImage(ROE)) {
@ -3302,16 +3301,15 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
} }
// on code les regularites G1 entre : // code regularities G1 between :
// - sphere et tuyau : une root est un vertex, l'autre un edge // - sphere and tube : one root is a vertex, the other is an edge
// et le vertex est inclus dans l'edge // and the vertex is included in the edge
// - face et tuyau : une root est une face, l'autre un edge // - face and tube : one root is a face, the other an edge
// et l'edge est inclus dans la face // and the edge is included in the face
// - face et face : si les 2 faces root sont tangentes dans // - face and face : if two root faces are tangent in
// le shape initial, elles le seront dans // the initial shape, they will be tangent in the offset shape
// le shape offset // - tube and tube : if 2 edges generating tubes are
// - tuyau et tuyau : si les 2 edges generant les tuyaux sont // tangents, the 2 will be tangent either.
// tangents, les 2 tuyaux le seront.
if ( Type1 == TopAbs_EDGE && Type2 == TopAbs_VERTEX) { if ( Type1 == TopAbs_EDGE && Type2 == TopAbs_VERTEX) {
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
TopExp::Vertices(TopoDS::Edge(Root1), V1, V2); TopExp::Vertices(TopoDS::Edge(Root1), V1, V2);
@ -3345,8 +3343,8 @@ void BRepOffset_MakeOffset::EncodeRegularity ()
} }
} }
else if ( Type1 == TopAbs_FACE && Type2 == TopAbs_FACE) { else if ( Type1 == TopAbs_FACE && Type2 == TopAbs_FACE) {
// si les 2 faces root sont tangentes dans le shape initial, // if two root faces are tangent in
// elles le seront dans le shape offset // the initial shape, they will be tangent in the offset shape
TopTools_ListOfShape LE,LV; TopTools_ListOfShape LE,LV;
BRepOffset_Tool::HasCommonShapes(TopoDS::Face(Root1), BRepOffset_Tool::HasCommonShapes(TopoDS::Face(Root1),
TopoDS::Face(Root2), TopoDS::Face(Root2),
@ -3408,7 +3406,7 @@ static void UpdateTolerance (TopoDS_Shape& S,
TopTools_MapOfShape View; TopTools_MapOfShape View;
TopoDS_Vertex V[2]; TopoDS_Vertex V[2];
// Les edges des bouchons ne sont pas modifiees. // The edges of caps are not modified.
TopTools_MapIteratorOfMapOfShape it; TopTools_MapIteratorOfMapOfShape it;
for (it.Initialize(Faces); it.More(); it.Next()) { for (it.Initialize(Faces); it.More(); it.Next()) {
const TopoDS_Shape& F = it.Key(); const TopoDS_Shape& F = it.Key();
@ -3435,7 +3433,7 @@ static void UpdateTolerance (TopoDS_Shape& S,
TV->Tolerance(0.); TV->Tolerance(0.);
Handle(BRepCheck_Vertex) VertexCorrector = new BRepCheck_Vertex(V[i]); Handle(BRepCheck_Vertex) VertexCorrector = new BRepCheck_Vertex(V[i]);
B.UpdateVertex (V[i],VertexCorrector->Tolerance()); B.UpdateVertex (V[i],VertexCorrector->Tolerance());
// on profite de l occasion pour purger le vertex. // use the occasion to clean the vertices.
(TV->ChangePoints()).Clear(); (TV->ChangePoints()).Clear();
} }
B.UpdateVertex(V[i],Tol); B.UpdateVertex(V[i],Tol);

View File

@ -83,8 +83,7 @@ static void UpdateEdge(const TopoDS_Edge& E,
const TopLoc_Location& L, const TopLoc_Location& L,
const Standard_Real Tol) const Standard_Real Tol)
{ {
// Detrime les courbes pour eviter des copies dans // Cut curves to avoid copies in the extensions.
//les extensions.
BRep_Builder B; BRep_Builder B;
Handle(Geom_TrimmedCurve) BC = Handle(Geom_TrimmedCurve)::DownCast(C); Handle(Geom_TrimmedCurve) BC = Handle(Geom_TrimmedCurve)::DownCast(C);
if (!BC.IsNull()) { if (!BC.IsNull()) {
@ -105,8 +104,7 @@ static void UpdateEdge(const TopoDS_Edge& E,
const TopoDS_Face& F, const TopoDS_Face& F,
const Standard_Real Tol) const Standard_Real Tol)
{ {
// Detrime les courbes pour eviter des copies dans // Cut curves to avoid copies in the extensions.
//les extensions.
BRep_Builder B; BRep_Builder B;
Handle(Geom2d_TrimmedCurve) BC = Handle(Geom2d_TrimmedCurve)::DownCast(C); Handle(Geom2d_TrimmedCurve) BC = Handle(Geom2d_TrimmedCurve)::DownCast(C);
if (!BC.IsNull()) { if (!BC.IsNull()) {
@ -128,8 +126,7 @@ static void UpdateEdge (const TopoDS_Edge& E,
const TopoDS_Face& F, const TopoDS_Face& F,
const Standard_Real Tol) const Standard_Real Tol)
{ {
// Detrime les courbes pour eviter des copies dans // Cut curves to avoid copies in the extensions.
//les extensions.
BRep_Builder B; BRep_Builder B;
Handle(Geom2d_Curve) NC1,NC2; Handle(Geom2d_Curve) NC1,NC2;
Handle(Geom2d_TrimmedCurve) BC1 = Handle(Geom2d_TrimmedCurve)::DownCast(C1); Handle(Geom2d_TrimmedCurve) BC1 = Handle(Geom2d_TrimmedCurve)::DownCast(C1);
@ -142,7 +139,7 @@ static void UpdateEdge (const TopoDS_Edge& E,
//======================================================================= //=======================================================================
//function : Range3d //function : Range3d
//purpose : Set the range only on the 3d curve //purpose : Set the range only on the 3d curve
// en attendant que le BRep_Builder le fasse !! // waitint that BRep_Builder does it !!
//======================================================================= //=======================================================================
static void Range3d (const TopoDS_Edge& E, static void Range3d (const TopoDS_Edge& E,
@ -193,14 +190,14 @@ static void ComputeCurve3d(TopoDS_Edge Edge,
Standard_Boolean IsComputed = Standard_False; Standard_Boolean IsComputed = Standard_False;
// Seach only isos on analytiques surfaces. // Search only isos on analytic surfaces.
Geom2dAdaptor_Curve C(Curve); Geom2dAdaptor_Curve C(Curve);
GeomAdaptor_Surface S(Surf); GeomAdaptor_Surface S(Surf);
GeomAbs_CurveType CTy = C.GetType(); GeomAbs_CurveType CTy = C.GetType();
GeomAbs_SurfaceType STy = S.GetType(); GeomAbs_SurfaceType STy = S.GetType();
BRep_Builder TheBuilder; BRep_Builder TheBuilder;
if ( STy != GeomAbs_Plane) { // if plane buildcurve3d gere KPart if ( STy != GeomAbs_Plane) { // if plane buildcurve3d manage KPart
if ( CTy == GeomAbs_Line) { if ( CTy == GeomAbs_Line) {
gp_Dir2d D = C.Line().Direction(); gp_Dir2d D = C.Line().Direction();
if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V.
@ -281,10 +278,10 @@ static void ComputeCurve3d(TopoDS_Edge Edge,
gp_Sphere Sph = S.Sphere(); gp_Sphere Sph = S.Sphere();
gp_Pnt2d P = C.Line().Location(); gp_Pnt2d P = C.Line().Location();
gp_Ax3 Axis = Sph.Position(); gp_Ax3 Axis = Sph.Position();
// calculde l'iso 0. // calculate iso 0.
gp_Circ Ci = ElSLib::SphereUIso(Axis, Sph.Radius(),0.); gp_Circ Ci = ElSLib::SphereUIso(Axis, Sph.Radius(),0.);
// mise a sameparameter (rotation du cercle - decalage du Y) // set to sameparameter (rotation of circle - offset of Y)
gp_Dir DRev = Axis.XDirection().Crossed(Axis. Direction()); gp_Dir DRev = Axis.XDirection().Crossed(Axis. Direction());
gp_Ax1 AxeRev(Axis.Location(),DRev); gp_Ax1 AxeRev(Axis.Location(),DRev);
Ci.Rotate(AxeRev, P.Y()); Ci.Rotate(AxeRev, P.Y());

View File

@ -143,7 +143,7 @@ static void BuildDomains(TopoDS_Face& myFace,
// Modified by Sergey KHROMOV - Thu Apr 26 16:04:44 2001 End // Modified by Sergey KHROMOV - Thu Apr 26 16:04:44 2001 End
FR.Init(myFace,Standard_True); FR.Init(myFace,Standard_True);
//==================================================== //====================================================
// Construction des faces limites par les wires fermes. // Construction of faces limited by closed wires.
//==================================================== //====================================================
TopTools_ListIteratorOfListOfShape itl(WorkWires); TopTools_ListIteratorOfListOfShape itl(WorkWires);
for (; itl.More(); itl.Next()) { for (; itl.More(); itl.Next()) {
@ -170,7 +170,7 @@ static void BuildDomains(TopoDS_Face& myFace,
} }
//=========================================== //===========================================
// Pas de wire ferme => un seul domaine // No closed wire => only one domain
//=========================================== //===========================================
if (Faces.IsEmpty()) { if (Faces.IsEmpty()) {
TopoDS_Shape aLocalShape = myFace.EmptyCopied(); TopoDS_Shape aLocalShape = myFace.EmptyCopied();
@ -186,7 +186,7 @@ static void BuildDomains(TopoDS_Face& myFace,
} }
//==================================================== //====================================================
// Classification des wires ouverts. // Classification of open wires.
//==================================================== //====================================================
// for (TopTools_ListIteratorOfListOfShape itF(Faces); itF.More(); itF.Next()) { // for (TopTools_ListIteratorOfListOfShape itF(Faces); itF.More(); itF.Next()) {
TopTools_ListIteratorOfListOfShape itF; TopTools_ListIteratorOfListOfShape itF;
@ -201,7 +201,7 @@ static void BuildDomains(TopoDS_Face& myFace,
while (itW.More()) { while (itW.More()) {
TopoDS_Wire& W = TopoDS::Wire(itW.Value()); TopoDS_Wire& W = TopoDS::Wire(itW.Value());
//======================================================= //=======================================================
// Choix d un point sur le wire. + projection sur la face. // Choice of a point on the wire. + projection on the face.
//======================================================= //=======================================================
TopExp_Explorer exp(W,TopAbs_VERTEX); TopExp_Explorer exp(W,TopAbs_VERTEX);
TopoDS_Vertex V = TopoDS::Vertex(exp.Current()); TopoDS_Vertex V = TopoDS::Vertex(exp.Current());
@ -220,7 +220,7 @@ static void BuildDomains(TopoDS_Face& myFace,
} }
} }
if ( Found && (CL.Perform(PV) == TopAbs_IN)) { if ( Found && (CL.Perform(PV) == TopAbs_IN)) {
// On a trouve la face qui contient le wire on l enleve de la liste // The face that contains a wire is found and it is removed from the list
B.Add(F,W); B.Add(F,W);
LOW.Remove(itW); LOW.Remove(itW);
} }
@ -230,7 +230,7 @@ static void BuildDomains(TopoDS_Face& myFace,
} }
} }
//======================================== //========================================
// Creation des algos sur chaque domaine. // Creation of algorithms on each domain.
//======================================== //========================================
for (itF.Initialize(Faces); itF.More(); itF.Next()) { for (itF.Initialize(Faces); itF.More(); itF.Next()) {
BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin); BRepFill_OffsetWire Algo(TopoDS::Face(itF.Value()), myJoin);

View File

@ -79,8 +79,8 @@ const TopTools_ListOfShape& BRepOffsetAPI_MakeOffsetShape::Generated (const Topo
myOffsetShape.OffsetFacesFromShapes ().LastImage (S, myGenerated); myOffsetShape.OffsetFacesFromShapes ().LastImage (S, myGenerated);
if (!myOffsetShape.ClosingFaces().IsEmpty()) { if (!myOffsetShape.ClosingFaces().IsEmpty()) {
// Reverse les Shape generes dans le cas des solides minces. // Reverse generated shapes in case of small solids.
// Utile seulement pour les faces mais sans incidence sur les autres. // Useful only for faces without influence on others.
TopTools_ListIteratorOfListOfShape it(myGenerated); TopTools_ListIteratorOfListOfShape it(myGenerated);
for (; it.More(); it.Next()) for (; it.More(); it.Next())
it.Value().Reverse(); it.Value().Reverse();

View File

@ -110,7 +110,7 @@
//======================================================================= //=======================================================================
//function : PerformPlan //function : PerformPlan
//purpose : Construit s'il existe un plan de remplissage //purpose : Construct a plane of filling if exists
//======================================================================= //=======================================================================
static Standard_Boolean PerformPlan(const TopoDS_Wire& W, static Standard_Boolean PerformPlan(const TopoDS_Wire& W,
@ -196,7 +196,7 @@ static TopoDS_Solid MakeSolid(TopoDS_Shell& shell, const TopoDS_Wire& wire1,
if (!B) if (!B)
{ {
// Il faut boucher les extremites // It is necessary to close the extremities
B = PerformPlan(wire1, presPln, face1); B = PerformPlan(wire1, presPln, face1);
if (B) { if (B) {
B = PerformPlan(wire2, presPln, face2); B = PerformPlan(wire2, presPln, face2);
@ -363,13 +363,13 @@ void BRepOffsetAPI_ThruSections::Build()
// compute origin and orientation on wires to avoid twisted results // compute origin and orientation on wires to avoid twisted results
// and update wires to have same number of edges // and update wires to have same number of edges
// on utilise BRepFill_CompatibleWires // use BRepFill_CompatibleWires
TopTools_SequenceOfShape WorkingSections; TopTools_SequenceOfShape WorkingSections;
WorkingSections.Clear(); WorkingSections.Clear();
TopTools_DataMapOfShapeListOfShape WorkingMap; TopTools_DataMapOfShapeListOfShape WorkingMap;
WorkingMap.Clear(); WorkingMap.Clear();
// Calcul des sections de travail // Calculate the working sections
BRepFill_CompatibleWires Georges(myWires); BRepFill_CompatibleWires Georges(myWires);
Georges.Perform(); Georges.Perform();
if (Georges.IsDone()) { if (Georges.IsDone()) {
@ -379,7 +379,7 @@ void BRepOffsetAPI_ThruSections::Build()
myWires = WorkingSections; myWires = WorkingSections;
} }
// Calcul de la shape resultat // Calculate the resulting shape
if (myWires.Length() == 2 || myIsRuled) { if (myWires.Length() == 2 || myIsRuled) {
// create a ruled shell // create a ruled shell
CreateRuled(); CreateRuled();
@ -413,7 +413,7 @@ void BRepOffsetAPI_ThruSections::CreateRuled()
if (myIsSolid) { if (myIsSolid) {
// on regarde si le premier wire est identique au dernier // check if the first wire is the same as the last
Standard_Boolean vClosed = (myWires(1).IsSame(myWires(nbSects))) ; Standard_Boolean vClosed = (myWires(1).IsSame(myWires(nbSects))) ;
if (vClosed) { if (vClosed) {
@ -423,7 +423,7 @@ void BRepOffsetAPI_ThruSections::CreateRuled()
B.MakeSolid(solid); B.MakeSolid(solid);
B.Add(solid, shell); B.Add(solid, shell);
// verify the orientation the solid // verify the orientation of the solid
BRepClass3d_SolidClassifier clas3d(solid); BRepClass3d_SolidClassifier clas3d(solid);
clas3d.PerformInfinitePoint(Precision::Confusion()); clas3d.PerformInfinitePoint(Precision::Confusion());
if (clas3d.State() == TopAbs_IN) { if (clas3d.State() == TopAbs_IN) {
@ -536,19 +536,19 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
BRepTools_WireExplorer anExp; BRepTools_WireExplorer anExp;
Standard_Boolean w1Point = Standard_True; Standard_Boolean w1Point = Standard_True;
// on regarde si le premier wire est ponctuel // check if the first wire is punctual
for(anExp.Init(TopoDS::Wire(myWires(1))); anExp.More(); anExp.Next()) { for(anExp.Init(TopoDS::Wire(myWires(1))); anExp.More(); anExp.Next()) {
w1Point = w1Point && (BRep_Tool::Degenerated(anExp.Current())); w1Point = w1Point && (BRep_Tool::Degenerated(anExp.Current()));
} }
Standard_Boolean w2Point = Standard_True; Standard_Boolean w2Point = Standard_True;
// on regarde si le dernier wire est ponctuel // check if the last wire is punctual
for(anExp.Init(TopoDS::Wire(myWires(nbSects))); anExp.More(); anExp.Next()) { for(anExp.Init(TopoDS::Wire(myWires(nbSects))); anExp.More(); anExp.Next()) {
w2Point = w2Point && (BRep_Tool::Degenerated(anExp.Current())); w2Point = w2Point && (BRep_Tool::Degenerated(anExp.Current()));
} }
Standard_Boolean vClosed = Standard_False; Standard_Boolean vClosed = Standard_False;
// on regarde si le premier wire est identique au dernier // check if the first wire is the same as last
if (myWires(1).IsSame(myWires(myWires.Length()))) vClosed = Standard_True; if (myWires(1).IsSame(myWires(myWires.Length()))) vClosed = Standard_True;
// find the dimension // find the dimension
@ -572,13 +572,13 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
for (i=1; i<=nbSects; i++) { for (i=1; i<=nbSects; i++) {
const TopoDS_Wire& wire = TopoDS::Wire(myWires(i)); const TopoDS_Wire& wire = TopoDS::Wire(myWires(i));
if (!wire.Closed()) { if (!wire.Closed()) {
// on regarde quand meme si les vertex sont les memes. // check if the vertices are the same
TopoDS_Vertex V1, V2; TopoDS_Vertex V1, V2;
TopExp::Vertices(wire,V1,V2); TopExp::Vertices(wire,V1,V2);
if ( !V1.IsSame(V2)) uClosed = Standard_False; if ( !V1.IsSame(V2)) uClosed = Standard_False;
} }
if ( (i==1 && w1Point) || (i==nbSects && w2Point) ) { if ( (i==1 && w1Point) || (i==nbSects && w2Point) ) {
// si le wire est ponctuel // if the wire is punctual
anExp.Init(TopoDS::Wire(wire)); anExp.Init(TopoDS::Wire(wire));
for(j=1; j<=nbEdges; j++) { for(j=1; j<=nbEdges; j++) {
nb++; nb++;
@ -586,7 +586,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
} }
} }
else { else {
// sinon // otherwise
for(anExp.Init(TopoDS::Wire(wire)); anExp.More(); anExp.Next()) { for(anExp.Init(TopoDS::Wire(wire)); anExp.More(); anExp.Next()) {
nb++; nb++;
shapes(nb) = anExp.Current(); shapes(nb) = anExp.Current();
@ -616,8 +616,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
Standard_Integer nbPnts = 21; Standard_Integer nbPnts = 21;
TColgp_Array2OfPnt points(1, nbPnts, 1, nbSects); TColgp_Array2OfPnt points(1, nbPnts, 1, nbSects);
// on concatene chaque section pour obtenir une surface totale que // concatenate each section to get a total surface that will be segmented
// l'on va segmenter
Handle(Geom_BSplineSurface) TS; Handle(Geom_BSplineSurface) TS;
TS = TotalSurf(shapes,nbSects,nbEdges,w1Point,w2Point,vClosed); TS = TotalSurf(shapes,nbSects,nbEdges,w1Point,w2Point,vClosed);
@ -628,7 +627,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
TopoDS_Shape firstEdge; TopoDS_Shape firstEdge;
for (i=1; i<=nbEdges; i++) { for (i=1; i<=nbEdges; i++) {
// segmentation de TS // segmentation of TS
Handle(Geom_BSplineSurface) surface; Handle(Geom_BSplineSurface) surface;
surface = Handle(Geom_BSplineSurface)::DownCast(TS->Copy()); surface = Handle(Geom_BSplineSurface)::DownCast(TS->Copy());
Standard_Real Ui1,Ui2,V0,V1; Standard_Real Ui1,Ui2,V0,V1;
@ -638,7 +637,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
V1 = surface->VKnot(surface->LastVKnotIndex()); V1 = surface->VKnot(surface->LastVKnotIndex());
surface->Segment(Ui1,Ui2,V0,V1); surface->Segment(Ui1,Ui2,V0,V1);
// recuperation des vertices // return vertices
edge = TopoDS::Edge(shapes(i)); edge = TopoDS::Edge(shapes(i));
TopExp::Vertices(edge,v1f,v1l); TopExp::Vertices(edge,v1f,v1l);
if (edge.Orientation() == TopAbs_REVERSED) if (edge.Orientation() == TopAbs_REVERSED)
@ -662,7 +661,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
// --- edge 1 // --- edge 1
if ( w1Point ) { if ( w1Point ) {
// copie de l'edge degeneree // copy the degenerated edge
TopoDS_Shape aLocalShape = shapes(1).EmptyCopied(); TopoDS_Shape aLocalShape = shapes(1).EmptyCopied();
edge1 = TopoDS::Edge(aLocalShape); edge1 = TopoDS::Edge(aLocalShape);
// edge1 = TopoDS::Edge(shapes(1).EmptyCopied()); // edge1 = TopoDS::Edge(shapes(1).EmptyCopied());
@ -676,8 +675,8 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
v1l.Orientation(TopAbs_REVERSED); v1l.Orientation(TopAbs_REVERSED);
B.Add(edge1, v1l); B.Add(edge1, v1l);
B.Range(edge1, f1, l1); B.Range(edge1, f1, l1);
// traitement des sections bouclantes // processing of looping sections
// on stocke les edges de la 1ere section // store edges of the 1st section
if (vClosed) if (vClosed)
vcouture(i) = edge1; vcouture(i) = edge1;
@ -687,7 +686,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed()
edge2 = TopoDS::Edge(vcouture(i)); edge2 = TopoDS::Edge(vcouture(i));
else { else {
if ( w2Point ) { if ( w2Point ) {
// copie de l'edge degeneree // copy of the degenerated edge
TopoDS_Shape aLocalShape = shapes(nbSects*nbEdges).EmptyCopied(); TopoDS_Shape aLocalShape = shapes(nbSects*nbEdges).EmptyCopied();
edge2 = TopoDS::Edge(aLocalShape); edge2 = TopoDS::Edge(aLocalShape);
// edge2 = TopoDS::Edge(shapes(nbSects*nbEdges).EmptyCopied()); // edge2 = TopoDS::Edge(shapes(nbSects*nbEdges).EmptyCopied());
@ -886,7 +885,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
for (j=jdeb; j<=jfin; j++) { for (j=jdeb; j<=jfin; j++) {
// cas des sections bouclantes // case of looping sections
if (j==jfin && vClosed) { if (j==jfin && vClosed) {
section.AddCurve(BS1); section.AddCurve(BS1);
} }
@ -895,7 +894,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
// read the first edge to initialise CompBS; // read the first edge to initialise CompBS;
edge = TopoDS::Edge(shapes((j-1)*NbEdges+1)); edge = TopoDS::Edge(shapes((j-1)*NbEdges+1));
if (BRep_Tool::Degenerated(edge)) { if (BRep_Tool::Degenerated(edge)) {
// edge degeneree : construction d'une courbe ponctuelle // degenerated edge : construction of a punctual curve
TopExp::Vertices(edge,vl,vf); TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf); Extremities(1) = BRep_Tool::Pnt(vf);
@ -906,7 +905,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
curv->LastParameter()); curv->LastParameter());
} }
else { else {
// recuperation de la courbe sur l'edge // recover the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last); Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last); curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation()); curvTrim->Transform(loc.Transformation());
@ -915,7 +914,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
curvTrim->Reverse(); curvTrim->Reverse();
} }
// transformation en BSpline reparametree sur [i-1,i] // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim); curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) { if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve(); Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
@ -933,14 +932,14 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
BSplCLib::Reparametrize(0.,1.,BSK); BSplCLib::Reparametrize(0.,1.,BSK);
curvBS->SetKnots(BSK); curvBS->SetKnots(BSK);
// initialisation // initialization
GeomConvert_CompCurveToBSplineCurve CompBS(curvBS); GeomConvert_CompCurveToBSplineCurve CompBS(curvBS);
for (i=2; i<=NbEdges; i++) { for (i=2; i<=NbEdges; i++) {
// read the edge // read the edge
edge = TopoDS::Edge(shapes((j-1)*NbEdges+i)); edge = TopoDS::Edge(shapes((j-1)*NbEdges+i));
if (BRep_Tool::Degenerated(edge)) { if (BRep_Tool::Degenerated(edge)) {
// edge degeneree : construction d'une courbe ponctuelle // degenerated edge : construction of a punctual curve
TopExp::Vertices(edge,vl,vf); TopExp::Vertices(edge,vl,vf);
TColgp_Array1OfPnt Extremities(1,2); TColgp_Array1OfPnt Extremities(1,2);
Extremities(1) = BRep_Tool::Pnt(vf); Extremities(1) = BRep_Tool::Pnt(vf);
@ -951,7 +950,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
curv->LastParameter()); curv->LastParameter());
} }
else { else {
// recuperation de la courbe sur l'edge // return the curve on the edge
Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last); Handle(Geom_Curve) curv = BRep_Tool::Curve(edge, loc, first, last);
curvTrim = new Geom_TrimmedCurve(curv, first, last); curvTrim = new Geom_TrimmedCurve(curv, first, last);
curvTrim->Transform(loc.Transformation()); curvTrim->Transform(loc.Transformation());
@ -960,7 +959,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
curvTrim->Reverse(); curvTrim->Reverse();
} }
// transformation en BSpline reparametree sur [i-1,i] // transformation into BSpline reparameterized on [i-1,i]
curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim); curvBS = Handle(Geom_BSplineCurve)::DownCast(curvTrim);
if (curvBS.IsNull()) { if (curvBS.IsNull()) {
Handle(Geom_Curve) theCurve = curvTrim->BasisCurve(); Handle(Geom_Curve) theCurve = curvTrim->BasisCurve();
@ -986,11 +985,11 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::
1); 1);
} }
// recuperation de la section finale // return the final section
BS = CompBS.BSplineCurve(); BS = CompBS.BSplineCurve();
section.AddCurve(BS); section.AddCurve(BS);
// cas des sections bouclantes // case of looping sections
if (j==jdeb && vClosed) { if (j==jdeb && vClosed) {
BS1 = BS; BS1 = BS;
} }
@ -1088,7 +1087,7 @@ TopoDS_Shape BRepOffsetAPI_ThruSections::GeneratedFace(const TopoDS_Shape& edge)
//======================================================================= //=======================================================================
//function : CriteriumWeight //function : CriteriumWeight
//purpose : returns the Weights associed to the criterium used in //purpose : returns the Weights associated to the criterium used in
// the optimization. // the optimization.
//======================================================================= //=======================================================================
// //

View File

@ -14,7 +14,7 @@
#include <Geom_Circle.hxx> #include <Geom_Circle.hxx>
#include <Geom2d_Circle.hxx> #include <Geom2d_Circle.hxx>
// parametres sur le meridien // parameters on the meridian
#define PMIN (-0.5*PI) #define PMIN (-0.5*PI)
#define PMAX (0.5*PI) #define PMAX (0.5*PI)

View File

@ -14,7 +14,7 @@
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
//-- lbr le 13 decembre 95
static gp_Ax2 ConeComputeAxes() { static gp_Ax2 ConeComputeAxes() {
static Standard_Integer firsttime=1; static Standard_Integer firsttime=1;
static Standard_Integer modif=0; static Standard_Integer modif=0;

View File

@ -12,7 +12,7 @@
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
//-- lbr le 13 decembre 95
static gp_Ax2 CylinderComputeAxes() { static gp_Ax2 CylinderComputeAxes() {
static Standard_Integer firsttime=1; static Standard_Integer firsttime=1;
static Standard_Integer modif=0; static Standard_Integer modif=0;

View File

@ -24,7 +24,7 @@
// 1) return true if extrema are found. // 1) return true if extrema are found.
// 2) Set in: // 2) Set in:
// - Dist : The lower distance found. // - Dist : The lower distance found.
// - anOppositePnt : The corresponding point laying on the face // - anOppositePnt : The corresponding point lying on the face
// - U,V : The parameters of <anOppositePnt> on the face <aFace> // - U,V : The parameters of <anOppositePnt> on the face <aFace>
//======================================================================= //=======================================================================
@ -102,7 +102,7 @@ BRepPrimAPI_MakeHalfSpace::BRepPrimAPI_MakeHalfSpace(const TopoDS_Face& Face,
myBuilder.MakeShell(Shell); myBuilder.MakeShell(Shell);
myBuilder.Add(Shell,Face); myBuilder.Add(Shell,Face);
// Normale, produit scalaire et sens. // Normal, scalair product and direction.
Standard_Real Prec = gp::Resolution(); Standard_Real Prec = gp::Resolution();
// BRepLProp_SLProps Props(BRepAdaptor_Surface(Face),U,V,2,Prec); // BRepLProp_SLProps Props(BRepAdaptor_Surface(Face),U,V,2,Prec);
BRepLProp_SLProps Props = BRepLProp_SLProps(BRepAdaptor_Surface(Face),U,V,2,Prec); BRepLProp_SLProps Props = BRepLProp_SLProps(BRepAdaptor_Surface(Face),U,V,2,Prec);
@ -110,10 +110,10 @@ BRepPrimAPI_MakeHalfSpace::BRepPrimAPI_MakeHalfSpace(const TopoDS_Face& Face,
gp_Dir OppRef(RefPnt.XYZ()-MinPnt.XYZ()); gp_Dir OppRef(RefPnt.XYZ()-MinPnt.XYZ());
Standard_Real Sca = Normale*OppRef; Standard_Real Sca = Normale*OppRef;
// Construction du solide ouvert. // Construction of the open solid.
myBuilder.MakeSolid(mySolid); myBuilder.MakeSolid(mySolid);
if (Sca > 0.) { if (Sca > 0.) {
// Directions identiques: cas inverse. // Same directions: inverted case.
Shell.Reverse(); Shell.Reverse();
} }
@ -139,7 +139,7 @@ BRepPrimAPI_MakeHalfSpace::BRepPrimAPI_MakeHalfSpace(const TopoDS_Shell& Shell,
Standard_Real MinDist = RealLast(); Standard_Real MinDist = RealLast();
Standard_Real CurDist, U, V, MinU=0, MinV=0; Standard_Real CurDist, U, V, MinU=0, MinV=0;
// Chercher le point de la peau le plus proche du point de reference. // Find the point of the skin closest to the reference point.
Standard_Boolean YaExt = Standard_False; Standard_Boolean YaExt = Standard_False;
TopoDS_Shell aShell = Shell; TopoDS_Shell aShell = Shell;
@ -160,7 +160,7 @@ BRepPrimAPI_MakeHalfSpace::BRepPrimAPI_MakeHalfSpace(const TopoDS_Shell& Shell,
} }
if ( YaExt) { if ( YaExt) {
// Normale, produit scalaire et sens. // Normal, scalar product and direction.
BRep_Builder myBuilder; BRep_Builder myBuilder;
Standard_Real Prec = gp::Resolution(); Standard_Real Prec = gp::Resolution();
// BRepLProp_SLProps Props(BRepAdaptor_Surface(MinFace),MinU,MinV,2,Prec); // BRepLProp_SLProps Props(BRepAdaptor_Surface(MinFace),MinU,MinV,2,Prec);
@ -169,10 +169,10 @@ BRepPrimAPI_MakeHalfSpace::BRepPrimAPI_MakeHalfSpace(const TopoDS_Shell& Shell,
gp_Dir OppRef(RefPnt.XYZ()-MinPnt.XYZ()); gp_Dir OppRef(RefPnt.XYZ()-MinPnt.XYZ());
Standard_Real Sca = Normale*OppRef; Standard_Real Sca = Normale*OppRef;
// Construction du solide ouvert. // Construction of the open solid.
myBuilder.MakeSolid(mySolid); myBuilder.MakeSolid(mySolid);
if (Sca > 0.) { if (Sca > 0.) {
// Directions identiques: cas inverse. // Same directions: inverted case.
aShell.Reverse(); aShell.Reverse();
} }
myBuilder.Add(mySolid,aShell); myBuilder.Add(mySolid,aShell);

View File

@ -13,7 +13,6 @@
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
//-- lbr le 13 decembre 95
static gp_Ax2 SphereComputeAxes() { static gp_Ax2 SphereComputeAxes() {
static Standard_Integer firsttime=1; static Standard_Integer firsttime=1;
static Standard_Integer modif=0; static Standard_Integer modif=0;

View File

@ -139,7 +139,7 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyVertex
(const TopoDS_Shape& aGenV, (const TopoDS_Shape& aGenV,
const Sweep_NumShape& aDirV) const Sweep_NumShape& aDirV)
{ {
//appele uniquement en mode de construction avec copie. //call only in construction mode with copy.
Standard_ConstructionError_Raise_if Standard_ConstructionError_Raise_if
(!myCopy,"BRepSweep_Translation::MakeEmptyVertex"); (!myCopy,"BRepSweep_Translation::MakeEmptyVertex");
gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aGenV)); gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aGenV));
@ -176,8 +176,8 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyDirectingEdge
O.Translate(V.Dot(gp_Vec(O,P)) * V); O.Translate(V.Dot(gp_Vec(O,P)) * V);
if (O.IsEqual(P,Precision::Confusion())) { if (O.IsEqual(P,Precision::Confusion())) {
// make a degenerated edge // make a degenerated edge
// temporairement on fout une courbe 3d nulle pour que les // temporary make 3D curve null so that
// parametres soient enregistres. // parameters should be registered.
// myBuilder.Builder().MakeEdge(E); // myBuilder.Builder().MakeEdge(E);
gp_Ax2 Axis(O,Dirz); gp_Ax2 Axis(O,Dirz);
Handle(Geom_Circle) GC = new Geom_Circle(Axis,0.); Handle(Geom_Circle) GC = new Geom_Circle(Axis,0.);
@ -211,8 +211,7 @@ TopoDS_Shape BRepSweep_Rotation::MakeEmptyGeneratingEdge
(const TopoDS_Shape& aGenE, (const TopoDS_Shape& aGenE,
const Sweep_NumShape& aDirV) const Sweep_NumShape& aDirV)
{ {
//appele dans le cas de construction avec copie, ou exceptionnellement //call in case of construction with copy, or only when meridian touches myaxe.
//lorsque le meridien touche myaxe.
Standard_Real First,Last; Standard_Real First,Last;
TopLoc_Location Loc; TopLoc_Location Loc;
Handle(Geom_Curve) C = Handle(Geom_Curve)::DownCast Handle(Geom_Curve) C = Handle(Geom_Curve)::DownCast
@ -243,8 +242,7 @@ void BRepSweep_Rotation::SetParameters
const TopoDS_Shape& aGenV, const TopoDS_Shape& aGenV,
const Sweep_NumShape&) const Sweep_NumShape&)
{ {
//Colle le parametre des vertex directement inclus dans les faces //Glue the parameter of vertices directly included in cap faces.
//bouchons.
gp_Pnt2d pnt2d = BRep_Tool::Parameters(TopoDS::Vertex(aGenV), gp_Pnt2d pnt2d = BRep_Tool::Parameters(TopoDS::Vertex(aGenV),
TopoDS::Face(aGenF)); TopoDS::Face(aGenF));
myBuilder.Builder().UpdateVertex myBuilder.Builder().UpdateVertex
@ -402,8 +400,8 @@ void BRepSweep_Rotation::SetPCurve
const Sweep_NumShape&, const Sweep_NumShape&,
const TopAbs_Orientation orien) const TopAbs_Orientation orien)
{ {
//Met sur edges des faces bouchons des pcurves identiques a celles //Set on edges of cap faces the same pcurves as
//des edges de la face generatrice. //on edges of the generator face.
Standard_Real First,Last; Standard_Real First,Last;
SetThePCurve(myBuilder.Builder(), SetThePCurve(myBuilder.Builder(),
TopoDS::Edge(aNewEdge), TopoDS::Edge(aNewEdge),

View File

@ -138,7 +138,7 @@ TopoDS_Shape BRepSweep_Translation::MakeEmptyGeneratingEdge
(const TopoDS_Shape& aGenE, (const TopoDS_Shape& aGenE,
const Sweep_NumShape& aDirV) const Sweep_NumShape& aDirV)
{ {
//Appele uniquement dans le cas de construction avec copie. //Call only in case of construction with copy.
Standard_ConstructionError_Raise_if Standard_ConstructionError_Raise_if
(!myCopy,"BRepSweep_Translation::MakeEmptyVertex"); (!myCopy,"BRepSweep_Translation::MakeEmptyVertex");
TopLoc_Location L; TopLoc_Location L;
@ -166,8 +166,7 @@ void BRepSweep_Translation::SetParameters
const TopoDS_Shape& aGenV, const TopoDS_Shape& aGenV,
const Sweep_NumShape&) const Sweep_NumShape&)
{ {
//Colle le parametre des vertex directement inclus dans les faces //Glue the parameter of vertices directly included in cap faces.
//bouchons.
gp_Pnt2d pnt2d = BRep_Tool::Parameters(TopoDS::Vertex(aGenV), gp_Pnt2d pnt2d = BRep_Tool::Parameters(TopoDS::Vertex(aGenV),
TopoDS::Face(aGenF)); TopoDS::Face(aGenF));
myBuilder.Builder().UpdateVertex myBuilder.Builder().UpdateVertex
@ -236,8 +235,7 @@ TopoDS_Shape BRepSweep_Translation::MakeEmptyFace
toler = BRep_Tool::Tolerance(TopoDS::Edge(aGenS)); toler = BRep_Tool::Tolerance(TopoDS::Edge(aGenS));
gp_Trsf Tr = L.Transformation(); gp_Trsf Tr = L.Transformation();
C = Handle(Geom_Curve)::DownCast(C->Copy()); C = Handle(Geom_Curve)::DownCast(C->Copy());
//les surfaces extrudees sont inverses par rapport a la topologie, donc //extruded surfaces are inverted correspondingly to the topology, so reverse.
//on reverse.
C->Transform(Tr); C->Transform(Tr);
gp_Dir D(myVec); gp_Dir D(myVec);
D.Reverse(); D.Reverse();
@ -289,8 +287,8 @@ void BRepSweep_Translation::SetPCurve
const Sweep_NumShape&, const Sweep_NumShape&,
const TopAbs_Orientation) const TopAbs_Orientation)
{ {
//Met sur edges des faces bouchons des pcurves identiques a celles //Set on edges of cap faces the same pcurves as
//des edges de la face generatrice. //edges of the generating face.
Standard_Real First,Last; Standard_Real First,Last;
myBuilder.Builder().UpdateEdge myBuilder.Builder().UpdateEdge
(TopoDS::Edge(aNewEdge), (TopoDS::Edge(aNewEdge),
@ -321,12 +319,11 @@ void BRepSweep_Translation::SetGeneratingPCurve
aNewOrientedEdge.Orientation(orien); aNewOrientedEdge.Orientation(orien);
if (AS.GetType()==GeomAbs_Plane){ if (AS.GetType()==GeomAbs_Plane){
/* on ne fait rien JAG /* nothing is done JAG
gp_Pln pln = AS.Plane(); gp_Pln pln = AS.Plane();
gp_Ax3 ax3 = pln.Position(); gp_Ax3 ax3 = pln.Position();
// JYL : l'ecriture suivante est bugatoire sur une arete construite avec une // JYL : the following produces bugs on an edge constructed from a trimmed 3D curve :
// courbe 3d trimmee. :
// //
// Handle(Geom_Line) // Handle(Geom_Line)
// GL = Handle(Geom_Line)::DownCast(BRep_Tool::Curve(TopoDS::Edge(aGenE), // GL = Handle(Geom_Line)::DownCast(BRep_Tool::Curve(TopoDS::Edge(aGenE),

View File

@ -730,7 +730,7 @@ static Standard_Integer vecdc(Draw_Interpretor& di,Standard_Integer ,const char*
//========================================================================== //==========================================================================
//function : wexplo //function : wexplo
// exploration d un wire // exploration of a wire
//========================================================================== //==========================================================================
static Standard_Integer wexplo (Draw_Interpretor&, static Standard_Integer wexplo (Draw_Interpretor&,
Standard_Integer argc, const char** argv) Standard_Integer argc, const char** argv)
@ -823,7 +823,7 @@ void BRepTest::BasicCommands(Draw_Interpretor& theCommands)
mkedgecurve,g); mkedgecurve,g);
theCommands.Add("fsameparameter", theCommands.Add("fsameparameter",
"fsameparameter shapename [tol (default 1.e-7)], \nforce le sameparameter sur toutes les aretes du shape", "fsameparameter shapename [tol (default 1.e-7)], \nforce sameparameter on all edges of the shape",
__FILE__, __FILE__,
sameparameter,g); sameparameter,g);

View File

@ -987,8 +987,8 @@ static Standard_Integer bsplineprof(Draw_Interpretor& di,
} }
} }
// //
// reste a faire : fermer le profil avec le premier point du contour // to be done : close the profile using the first point of the contour
// et le point pris avec mouse button 3 // and the point taken with mouse button 3
// //
Handle(Geom2d_BSplineCurve) C ; Handle(Geom2d_BSplineCurve) C ;
Handle(Geom_Curve) curve3d_ptr ; Handle(Geom_Curve) curve3d_ptr ;
@ -1559,7 +1559,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
TopOpeBRep_EdgesIntersector EInter; TopOpeBRep_EdgesIntersector EInter;
char name[100]; char name[100];
//------------------------------------------------------ //------------------------------------------------------
// Calcul des point d intersection en 2d // Calculate point of intersection 2D
//----------------------------------------------------- //-----------------------------------------------------
EInter.SetFaces(F,F); EInter.SetFaces(F,F);
Standard_Real TolInter = 1.e-7; Standard_Real TolInter = 1.e-7;
@ -1569,8 +1569,8 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
EInter.Perform (E[0],E[1],reducesegments); EInter.Perform (E[0],E[1],reducesegments);
if (EInter.IsEmpty()) { if (EInter.IsEmpty()) {
//cout << " Pas d'intersection trouvee" << endl; //cout << " No intersection found" << endl;
di << " Pas d'intersection trouvee" << "\n"; di << " No intersection found" << "\n";
return 0; return 0;
} }
@ -1590,8 +1590,8 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
DBRep::Set(name,V); DBRep::Set(name,V);
for (Standard_Integer i = 1; i <= 2; i++) { for (Standard_Integer i = 1; i <= 2; i++) {
//--------------------------------------------------------------- //---------------------------------------------------------------
// pour pouvoir ranger le parametre sur l edge // to be able to rank parameter on edge
// il faut le coder interne.... // it is necessary to code it internally
//--------------------------------------------------------------- //---------------------------------------------------------------
Standard_Real U = P2D.Parameter(i); Standard_Real U = P2D.Parameter(i);
@ -1600,7 +1600,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
// B.UpdateVertex(TopoDS::Vertex(V.Oriented(TopAbs_INTERNAL)), // B.UpdateVertex(TopoDS::Vertex(V.Oriented(TopAbs_INTERNAL)),
// U,E[i-1],Tol); // U,E[i-1],Tol);
//--------------------------------------------------------------- //---------------------------------------------------------------
// Orientation du vertex en fct de la transition. // Orientation of vertex in the transition.
//--------------------------------------------------------------- //---------------------------------------------------------------
TopAbs_Orientation OO = TopAbs_REVERSED; TopAbs_Orientation OO = TopAbs_REVERSED;
if (P2D.IsVertex(i)) { if (P2D.IsVertex(i)) {
@ -1609,8 +1609,8 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
else if (P2D.Transition(i).Before() == TopAbs_OUT) { else if (P2D.Transition(i).Before() == TopAbs_OUT) {
OO = TopAbs_FORWARD; OO = TopAbs_FORWARD;
} }
//cout << " Orientation du vertex " << NbV << " sur " << a[i+1] << ": "; //cout << " Orientation of vertex " << NbV << " on " << a[i+1] << ": ";
di << " Orientation du vertex " << NbV << " sur " << a[i+1] << ": "; di << " Orientation of vertex " << NbV << " on " << a[i+1] << ": ";
if (OO == TopAbs_FORWARD) { if (OO == TopAbs_FORWARD) {
//cout << "FORWARD" << endl; //cout << "FORWARD" << endl;
di << "FORWARD" << "\n"; di << "FORWARD" << "\n";
@ -1647,7 +1647,7 @@ static Standard_Integer concatwire(Draw_Interpretor&, Standard_Integer n, const
TopoDS_Wire res; TopoDS_Wire res;
res=BRepAlgo::ConcatenateWire(W,Option); //treatment res=BRepAlgo::ConcatenateWire(W,Option); //processing
DBRep::Set(c[1],res); DBRep::Set(c[1],res);
return 0; return 0;
} }
@ -1662,8 +1662,8 @@ Standard_Integer build3d(Draw_Interpretor& di,
{ {
if ( (n <2) || (n>3) ) { if ( (n <2) || (n>3) ) {
//cout << " 1 ou 2 arguments attendus" << endl; //cout << " 1 or 2 arguments expected" << endl;
di << " 1 ou 2 arguments attendus" << "\n"; di << " 1 or 2 arguments expected" << "\n";
return 1; return 1;
} }

View File

@ -212,13 +212,13 @@ static Standard_Integer CheckHist(Draw_Interpretor& di,
const char** ) const char** )
{ {
if(Rakk == 0) { if(Rakk == 0) {
//cout<<"Pas de Builder actif"<<endl; //cout<<"No active Builder"<<endl;
di<<"Pas de Builder actif"<<"\n"; di<<"No active Builder"<<"\n";
return 1; return 1;
} }
if(!Rakk->IsDone()) { if(!Rakk->IsDone()) {
//cout<<"Builder actif Not Done"<<endl; //cout<<"Active Builder Not Done"<<endl;
di<<"Builder actif Not Done"<<"\n"; di<<"Active Builder Not Done"<<"\n";
return 1; return 1;
} }
Standard_Integer nbc = Rakk->NbContours(); Standard_Integer nbc = Rakk->NbContours();
@ -274,8 +274,8 @@ static Standard_Integer UPDATEVOL(Draw_Interpretor& di,
const char** a) const char** a)
{ {
if(Rake == 0){ if(Rake == 0){
//cout << "MakeFillet non initialise"<<endl; //cout << "MakeFillet not initialized"<<endl;
di << "MakeFillet non initialise"<<"\n"; di << "MakeFillet not initialized"<<"\n";
return 1 ; return 1 ;
} }
if(narg%2 != 0 || narg < 4) return 1; if(narg%2 != 0 || narg < 4) return 1;
@ -298,8 +298,8 @@ static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
const char**) const char**)
{ {
if(Rake == 0){ if(Rake == 0){
//cout << "MakeFillet non initialise"<<endl; //cout << "MakeFillet not initialized"<<endl;
di << "MakeFillet non initialise"<<"\n"; di << "MakeFillet not initialized"<<"\n";
return 1 ; return 1 ;
} }
Rake->Build(); Rake->Build();
@ -317,7 +317,7 @@ static Standard_Integer BUILDEVOL(Draw_Interpretor& di,
//********************************************** //**********************************************
// commande des fusions et coupes avec conges * // command fuse and cut with fillets *
//********************************************** //**********************************************
Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a) Standard_Integer topoblend(Draw_Interpretor& di, Standard_Integer narg, const char** a)
@ -497,7 +497,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet"<<"\n"; else if (err==FilletSurf_PbFilletCompute) di <<"StatusError=PBFillet"<<"\n";
} }
else { else {
if (Rakk.IsDone()==FilletSurf_IsPartial) di <<"resultat partiel"<<"\n"; if (Rakk.IsDone()==FilletSurf_IsPartial) di <<"partial result"<<"\n";
nb=Rakk.NbSurface(); nb=Rakk.NbSurface();
char localname [100]; char localname [100];
@ -514,11 +514,11 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
//else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge) //else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
// {cout<<" type deb conges = WLBLEND"<<endl;} // {cout<<" type deb conges = WLBLEND"<<endl;}
if (Rakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge) if (Rakk.StartSectionStatus()==FilletSurf_NoExtremityOnEdge)
{di<<" type deb conges = WLBLOUT"<<"\n";} {di<<" type start fillets = WLBLOUT"<<"\n";}
else if (Rakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge ) else if (Rakk.StartSectionStatus()==FilletSurf_OneExtremityOnEdge )
{ di<<" type deb conges = WLBLSTOP"<<"\n";} { di<<" type start fillets = WLBLSTOP"<<"\n";}
else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge) else if (Rakk.StartSectionStatus()==FilletSurf_TwoExtremityOnEdge)
{di<<" type deb conges = WLBLEND"<<"\n";} {di<<" type start fillets = WLBLEND"<<"\n";}
//if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge) //if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
// {cout<<" type fin conges = WLBLOUT"<<endl;} // {cout<<" type fin conges = WLBLOUT"<<endl;}
@ -527,30 +527,30 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
//else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge) //else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
// { cout<<" type fin conges = WLBLEND"<<endl;} // { cout<<" type fin conges = WLBLEND"<<endl;}
if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge) if (Rakk.EndSectionStatus()==FilletSurf_NoExtremityOnEdge)
{di<<" type fin conges = WLBLOUT"<<"\n";} {di<<" type end fillets = WLBLOUT"<<"\n";}
else if (Rakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge) else if (Rakk.EndSectionStatus()==FilletSurf_OneExtremityOnEdge)
{di<<" type fin conges = WLBLSTOP"<<"\n";} {di<<" type end fillets = WLBLSTOP"<<"\n";}
else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge) else if (Rakk.EndSectionStatus()==FilletSurf_TwoExtremityOnEdge)
{ di<<" type fin conges = WLBLEND"<<"\n";} { di<<" type end fillets = WLBLEND"<<"\n";}
Standard_Real f,l; Standard_Real f,l;
f = Rakk.FirstParameter(); f = Rakk.FirstParameter();
l = Rakk.LastParameter(); l = Rakk.LastParameter();
//cout<<"parametre sur edge debut : "<<f<<endl; //cout<<"parameter on edge start : "<<f<<endl;
//cout<<"parametre sur edge fin : "<<l<<endl; //cout<<"parameter on edge end : "<<l<<endl;
di<<"parametre sur edge debut : "<<f<<"\n"; di<<"parametre on edge start : "<<f<<"\n";
di<<"parametre sur edge fin : "<<l<<"\n"; di<<"parametre on edge end : "<<l<<"\n";
for (i=1;i<=nb;i++){ for (i=1;i<=nb;i++){
//precision //precision
//cout<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<endl; //cout<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<endl;
di<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<"\n"; di<<"precision "<< i << "= "<<Rakk.TolApp3d(i)<<"\n";
// affichage des surfaces resultats // display resulting surfaces
sprintf(localname, "%s%d" ,ns0,i); sprintf(localname, "%s%d" ,ns0,i);
temp = localname; temp = localname;
DrawTrSurf::Set(temp,Rakk.SurfaceFillet(i)); DrawTrSurf::Set(temp,Rakk.SurfaceFillet(i));
di << localname<< " "; di << localname<< " ";
//affichage des courbes 3d // display curves 3d
sprintf(localname, "%s%d" ,"courb1",i); sprintf(localname, "%s%d" ,"courb1",i);
temp =localname; temp =localname;
DrawTrSurf::Set(temp,Rakk.CurveOnFace1(i)); DrawTrSurf::Set(temp,Rakk.CurveOnFace1(i));
@ -560,7 +560,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
DrawTrSurf::Set(temp,Rakk.CurveOnFace2(i)); DrawTrSurf::Set(temp,Rakk.CurveOnFace2(i));
di << localname<< " "; di << localname<< " ";
// affichage des supports // display supports
sprintf(localname, "%s%d" ,"face1",i); sprintf(localname, "%s%d" ,"face1",i);
temp =localname ; temp =localname ;
DBRep::Set(temp,Rakk.SupportFace1(i)); DBRep::Set(temp,Rakk.SupportFace1(i));
@ -570,7 +570,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
DBRep::Set(temp,Rakk.SupportFace2(i)); DBRep::Set(temp,Rakk.SupportFace2(i));
di << localname<< " "; di << localname<< " ";
// affichage des Pcurve sur les faces // display Pcurves on faces
sprintf(localname, "%s%d" ,"pcurveonface1",i); sprintf(localname, "%s%d" ,"pcurveonface1",i);
temp =localname ; temp =localname ;
DrawTrSurf::Set(temp,Rakk.PCurveOnFace1(i)); DrawTrSurf::Set(temp,Rakk.PCurveOnFace1(i));
@ -580,7 +580,7 @@ static Standard_Integer blend1(Draw_Interpretor& di, Standard_Integer narg, cons
DrawTrSurf::Set(temp,Rakk.PCurveOnFace2(i)); DrawTrSurf::Set(temp,Rakk.PCurveOnFace2(i));
di << localname<< " "; di << localname<< " ";
// affichage des Pcurve sur le conge // display Pcurves on the fillet
sprintf(localname, "%s%d" ,"pcurveonconge1",i); sprintf(localname, "%s%d" ,"pcurveonconge1",i);
temp =localname; temp =localname;
DrawTrSurf::Set(temp,Rakk.PCurve1OnFillet(i)); DrawTrSurf::Set(temp,Rakk.PCurve1OnFillet(i));
@ -621,7 +621,7 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
if ( S.IsNull()) return 1; if ( S.IsNull()) return 1;
Standard_Real Rad = atof(a[3]); Standard_Real Rad = atof(a[3]);
Standard_Real Tol = t3d; //le meme que blend ! 1.e-7; Standard_Real Tol = t3d; //the same as blend ! 1.e-7;
BiTgte_Blend Roll; BiTgte_Blend Roll;
Roll.Init(S,Rad,Tol,Standard_False); Roll.Init(S,Rad,Tol,Standard_False);
@ -633,44 +633,44 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
continue; continue;
} }
if ( Nb == 0) { // on recupere les faces d'arret. if ( Nb == 0) { // return stop faces.
TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE)); TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
TopoDS_Face F1 = TopoDS::Face(aLocalFace); TopoDS_Face F1 = TopoDS::Face(aLocalFace);
// TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE)); // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
if ( F1.IsNull()) { if ( F1.IsNull()) {
//cout << " Face d'arret non reperee." << endl; //cout << " Stop face not referenced." << endl;
di << " Face d'arret non reperee." << "\n"; di << " Stop face not referenced." << "\n";
return 1; return 1;
} }
Roll.SetStoppingFace(F1); Roll.SetStoppingFace(F1);
} }
else if (Nb == 1) { // on recupere les faces sur lesquelles la bille roule else if (Nb == 1) { // return faces on which the ball rotates
TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE)); TopoDS_Shape aLocalFace(DBRep::Get(a[i],TopAbs_FACE));
TopoDS_Face F1 = TopoDS::Face(aLocalFace); TopoDS_Face F1 = TopoDS::Face(aLocalFace);
// TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE)); // TopoDS_Face F1 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
i++; i++;
if ( !strcmp(a[i],"@")) { if ( !strcmp(a[i],"@")) {
//cout << " Il faut un nombre pair de faces d'appui de la bille" << endl; //cout << " Even number of ball support faces is required " << endl;
di << " Il faut un nombre pair de faces d'appui de la bille" << "\n"; di << " Even number of ball support faces is required " << "\n";
return 1; return 1;
} }
aLocalFace = DBRep::Get(a[i],TopAbs_FACE); aLocalFace = DBRep::Get(a[i],TopAbs_FACE);
TopoDS_Face F2 = TopoDS::Face(aLocalFace); TopoDS_Face F2 = TopoDS::Face(aLocalFace);
// TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE)); // TopoDS_Face F2 = TopoDS::Face(DBRep::Get(a[i],TopAbs_FACE));
if ( F1.IsNull() || F2.IsNull()) { if ( F1.IsNull() || F2.IsNull()) {
//cout << " Face d'appui non reperee." << endl; //cout << " Support face not referenced." << endl;
di << " Face d'appui non reperee." << "\n"; di << " Support face not referenced." << "\n";
return 1; return 1;
} }
Roll.SetFaces(F1,F2); Roll.SetFaces(F1,F2);
} }
else if (Nb == 2) { // on recupere l'arete sur laquelle la bille roule else if (Nb == 2) { // return the edge on which the ball rotates
TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_EDGE)); TopoDS_Shape aLocalShape(DBRep::Get(a[i],TopAbs_EDGE));
TopoDS_Edge E = TopoDS::Edge(aLocalShape); TopoDS_Edge E = TopoDS::Edge(aLocalShape);
// TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE)); // TopoDS_Edge E = TopoDS::Edge(DBRep::Get(a[i],TopAbs_EDGE));
if ( E.IsNull()) { if ( E.IsNull()) {
//cout << " Edge non repere." << endl; //cout << " Edge not referenced." << endl;
di << " Edge non repere." << "\n"; di << " Edge not referenced." << "\n";
return 1; return 1;
} }
Roll.SetEdge(E); Roll.SetEdge(E);
@ -688,9 +688,9 @@ Standard_Integer rollingball(Draw_Interpretor& di, Standard_Integer n, const cha
for (Standard_Integer i = 1; i <= NbBranches; i++) { for (Standard_Integer i = 1; i <= NbBranches; i++) {
Standard_Integer From,To; Standard_Integer From,To;
Roll.IndicesOfBranche(i,From,To); Roll.IndicesOfBranche(i,From,To);
//cout << " Indices de la " << i << "eme Branche : "; //cout << " Indexes of the " << i << "th Branch : ";
//cout << " " << From << " " << To << endl; //cout << " " << From << " " << To << endl;
di << " Indices de la " << i << "eme Branche : "; di << " Indexes of the " << i << "th Branch : ";
di << " " << From << " " << To << "\n"; di << " " << From << " " << To << "\n";
for (Standard_Integer j = From; j <= To; j++) { for (Standard_Integer j = From; j <= To; j++) {
const TopoDS_Shape& CurF = Roll.Face(j); const TopoDS_Shape& CurF = Roll.Face(j);

View File

@ -54,7 +54,7 @@ static void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
//========================================================================== //==========================================================================
//function : topoLoad //function : topoLoad
// chargement d une face dans l explorer. // loading of a face in the explorer.
//========================================================================== //==========================================================================
static Standard_Integer topoload (Draw_Interpretor& , Standard_Integer argc, const char** argv) static Standard_Integer topoload (Draw_Interpretor& , Standard_Integer argc, const char** argv)
{ {
@ -70,7 +70,7 @@ static Standard_Integer topoload (Draw_Interpretor& , Standard_Integer argc, con
//========================================================================== //==========================================================================
//function : drawcont //function : drawcont
// visualisation du contour defini par l explorateur. // visualization of the contour defined by the explorer.
//========================================================================== //==========================================================================
static Standard_Integer drawcont(Draw_Interpretor& , Standard_Integer , const char**) static Standard_Integer drawcont(Draw_Interpretor& , Standard_Integer , const char**)
{ {
@ -86,8 +86,8 @@ static Standard_Integer drawcont(Draw_Interpretor& , Standard_Integer , const ch
//========================================================================== //==========================================================================
//function : mat //function : mat
// calcul de la carte des lieux bisecteur sur le contour defini // calculate the map of locations bisector on the contour defined by
// par l explorateur. // the explorer.
//========================================================================== //==========================================================================
static Standard_Integer mat(Draw_Interpretor& , Standard_Integer, const char**) static Standard_Integer mat(Draw_Interpretor& , Standard_Integer, const char**)
{ {
@ -97,11 +97,11 @@ static Standard_Integer mat(Draw_Interpretor& , Standard_Integer, const char**)
return 0; return 0;
} }
//========================================================================== //============================================================================
//function : zone //function : zone
// construction et affichage de la zone de proximite associee aux // construction and display of the proximity zone associated to the
// elements de base definis par l edge ou le vertex. // base elements defined by the edge or the vertex.
//========================================================================== //============================================================================
static Standard_Integer zone(Draw_Interpretor& , Standard_Integer argc , const char** argv) static Standard_Integer zone(Draw_Interpretor& , Standard_Integer argc , const char** argv)
{ {
if (argc < 2) return 1; if (argc < 2) return 1;
@ -132,8 +132,8 @@ static Standard_Integer zone(Draw_Interpretor& , Standard_Integer argc , const c
//========================================================================== //==========================================================================
//function : side //function : side
// side = left => calcul a gauche du contour. // side = left => calculation to the left of the contour.
// side = right => calcul a droite du contour. // side = right => calculation to the right of the contour.
//========================================================================== //==========================================================================
static Standard_Integer side(Draw_Interpretor& , Standard_Integer, const char** argv) static Standard_Integer side(Draw_Interpretor& , Standard_Integer, const char** argv)
@ -148,7 +148,7 @@ static Standard_Integer side(Draw_Interpretor& , Standard_Integer, const char**
//========================================================================== //==========================================================================
//function : result //function : result
// Affichage complet de la carte calculee. // Complete display of the calculated map.
//========================================================================== //==========================================================================
static Standard_Integer result(Draw_Interpretor& , Standard_Integer, const char**) static Standard_Integer result(Draw_Interpretor& , Standard_Integer, const char**)
{ {
@ -165,12 +165,11 @@ static Standard_Integer result(Draw_Interpretor& , Standard_Integer, const char*
//========================================================================== //==========================================================================
//function : DrawCurve //function : DrawCurve
// Affichage d une courbe <aCurve> de Geom2d. dans une couleur // Display of curve <aCurve> of Geom2d in a color defined by <Indice>.
// definie par <Indice>. // Indice = 1 yellow,
// Indice = 1 jaune, // Indice = 2 blue,
// Indice = 2 bleu, // Indice = 3 red,
// Indice = 3 rouge, // Indice = 4 green.
// Indice = 4 vert.
//========================================================================== //==========================================================================
void DrawCurve(const Handle(Geom2d_Curve)& aCurve, void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
const Standard_Integer Indice) const Standard_Integer Indice)
@ -187,14 +186,14 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
curve =(*(Handle_Bisector_BisecAna*)&curve)->Geom2dCurve(); curve =(*(Handle_Bisector_BisecAna*)&curve)->Geom2dCurve();
type = curve->DynamicType(); type = curve->DynamicType();
} }
// PB de representation des courbes semi_infinies. // PB of representation of semi_infinite curves.
gp_Parab2d gpParabola; gp_Parab2d gpParabola;
gp_Hypr2d gpHyperbola; gp_Hypr2d gpHyperbola;
Standard_Real Focus; Standard_Real Focus;
Standard_Real Limit = 50000.; Standard_Real Limit = 50000.;
Standard_Real delta = 400; Standard_Real delta = 400;
// PB de representation des courbes semi_infinies. // PB of representation of semi_infinite curves.
if (aCurve->LastParameter() == Precision::Infinite()) { if (aCurve->LastParameter() == Precision::Infinite()) {
if (type == STANDARD_TYPE(Geom2d_Parabola)) { if (type == STANDARD_TYPE(Geom2d_Parabola)) {
@ -224,7 +223,7 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve,
else { else {
CurveDraw = aCurve; CurveDraw = aCurve;
} }
// fin PB. // end PB.
} }
else { else {
CurveDraw = aCurve; CurveDraw = aCurve;

Some files were not shown because too many files have changed in this diff Show More