- Updated comments in IGESGeom_ToolCircularArc, IGESGeom_ToolCurveOnSurface, IGESGeom_ToolOffsetCurve, IGESGeom_ToolPlane, IGESGeom_ToolSplineSurface, IGESGeom_ToolTransformationMatrix, IGESGraph_ToolColor, IGESGraph_ToolDrawingUnits, IGESSelect, IGESSelect_Activator, IGESSelect_RebuildGroups, IGESSelect_SelectBypassGroup, IGESSelect_SelectBypassSubfigure, IGESSelect_SignStatus, IGESSelect_ViewSorter, IGESSelect_WorkLibrary, IGESToBRep, IGESToBRep_BRepEntity, IGESToBRep_BasicCurve, IGESToBRep_BasicSurface, IGESToBRep_TopoCurve, IGESToBRep_TopoSurface to improve readability and understanding.
- Translated French comments to English where applicable.
- Ensured comments accurately reflect the functionality and intent of the code.
}
else
{
- // la fonction suivante force les surfaces indirectes en
- // surfaces directes (obligatoire dans IGES)
+ // the following function forces indirect surfaces to
+ // direct surfaces (mandatory in IGES)
// theShape = ShapeCustom::DirectFaces(start);
// sprintf(Name,"res_%d",Nb++);
// DBRep::Set(Name,theShape);
}
else
{
- // message d`erreur
+ // error message
}
}
}
else
{
- // message d`erreur
+ // error message
}
return res;
}
return res;
}
- // pour explorer la face , il faut la mettre fORWARD.
+ // to explore the face, it must be set to FORWARD.
TopoDS_Face aFace = start;
// Associates the input face (start) and its sub-shapes with the reversed variant,
// if the input face has a Reversed orientation
if (!Surf.IsNull())
{
Standard_Real U1, U2, V1, V2;
- // pour limiter les surfaces de base
+ // to limit the base surfaces
BRepTools::UVBounds(aFace, U1, U2, V1, V2);
GeomToIGES_GeomSurface GS;
GS.SetModel(GetModel());
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// modif le 25/03/96 mjm
+// modification on 25/03/96 mjm
// implement ShapeCustom::DirectModification for indirect surfaces (out of norm IGES)
//: l4 abv 12 Jan 99: CTS22022-2: correct writing reversed shells
//: n3 abv 8 Feb 99: PRO17820: BRepTools::OuterWire() -> ShapeAnalysis::OuterWire
}
//=============================================================================
-// Transfer des Entites Curve de Geom2d vers IGES
+// Transfer of Curve Entities from Geom2d to IGES
// Transfer2dCurve
//=============================================================================
}
//=============================================================================
-// Transfer de Point2d de Geom2d vers IGES
+// Transfer of Point2d from Geom2d to IGES
// Tranfer2dPoint
//=============================================================================
}
//=============================================================================
-// Transfer de CartesianPoint de Geom2d vers IGES
+// Transfer of CartesianPoint from Geom2d to IGES
// Tranfer2dPoint
//=============================================================================
}
//=============================================================================
-// Transfer des Entites Vector de Geom2d vers IGES
+// Transfer of Vector Entities from Geom2d to IGES
// Transfer2dVector
//=============================================================================
}
//=============================================================================
-// Transfer des Entites VectorWithMagnitude de Geom2d vers IGES
+// Transfer of VectorWithMagnitude Entities from Geom2d to IGES
// Transfer2dVector
//=============================================================================
}
//=============================================================================
-// Transfer des Entites Direction de Geom2d vers IGES
+// Transfer of Direction Entities from Geom2d to IGES
// Transfer2dVector
//=============================================================================
#include <TColStd_HArray1OfReal.hxx>
// Pour toutes les courbes infinies soit
-// Udeb <= -Precision::Infinite() et/ou Ufin >= Precision::Infinite()
-// on choisit arbitrairement de les construire entre
-// Udeb = -Precision::Infinite() et Ufin = Precision::Infinite()
+// Udeb <= -Precision::Infinite() and/or Ufin >= Precision::Infinite()
+// we arbitrarily choose to construct them between
+// Udeb = -Precision::Infinite() and Ufin = Precision::Infinite()
//=============================================================================
// GeomToIGES_GeomCurve
//=============================================================================
Standard_Boolean IPlan = Standard_False;
gp_XYZ Norm = gp_XYZ(0., 0., 1.);
- // Si la courbe est periodique, on passe par une fonction pour recuperer tous
- // les parametres necessaires a l`ecriture IGES.
+ // If the curve is periodic, we go through a function to recover all
+ // the parameters necessary for IGES writing.
Standard_Boolean IPerio = start->IsPeriodic();
Standard_Integer Index = Nbpoles - 1;
// Sequence des Knots de [-Deg, Index+1] dans IGESGeom.
- // et de [1, Nbpoles+Deg+1] dans Geom
+ // and from [1, Nbpoles+Deg+1] in Geom
Standard_Integer Knotindex;
Standard_Real rtampon;
TColStd_Array1OfReal K(1, Nbpoles + Deg + 1);
(start->Offset() / GetUnit()),
0.,
// clang-format off
- start->Direction().XYZ().Reversed(), U1, U2); //%11 pdn 12.01.99 // valeur (0,0,1) pour l'instant
+ start->Direction().XYZ().Reversed(), U1, U2); //%11 pdn 12.01.99 // value (0,0,1) for now
// clang-format on
res = OffsetC;
// commercial license or contractual agreement.
// modif du 14/09/95 mjm
-// prise en compte de l'unite choisi par l'utilisateur
-// pour l'ecriture du fichier IGES.
+// taking into account the unit chosen by the user
+// for writing the IGES file.
#include <Geom_CartesianPoint.hxx>
#include <Geom_Point.hxx>
}
//=============================================================================
-// Transfer de Point de Geom vers IGES
+// Transfer of Point from Geom to IGES
// TranferPoint
//=============================================================================
}
//=============================================================================
-// Transfer de Point de Geom vers IGES
+// Transfer of Point from Geom to IGES
// TranferPoint
//=============================================================================
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// modif du 22/10/96 mjm
-// ajout du champ TheLength
+// modification of 22/10/96 mjm
+// addition of TheLength field
//: l6 abv 15.01.99: CTS22022: writing full tori
// szv#4:S4163:12Mar99
// S4181 pdn 20.04.99 implementing of writing IGES elementary surfaces.
}
//=============================================================================
-// Transfer des Entites Surface de Geom vers IGES
+// Transfer of Surface Entities from Geom to IGES
// TransferSurface
//=============================================================================
}
//=============================================================================
-// Transfer des Entites BoundedSurface de Geom vers IGES
+// Transfer of BoundedSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
}
//=============================================================================
-// Transfer des Entites BSplineSurface de Geom vers IGES
+// Transfer of BSplineSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
Standard_Boolean Polynom = !(RationU || RationV); // szv#10:PRO19566:05Oct99 && was wrong
// filling knots array for U :
- // Sequence des Knots de [-DegU, IndexU+1] dans IGESGeom.
+ // Knots sequence from [-DegU, IndexU+1] in IGESGeom.
Standard_Integer Knotindex;
Standard_Real rtampon;
Standard_Integer itampon;
}
// filling knots array for V :
- // Sequence des Knots de [-DegV, IndexV+1] dans IGESGeom.
+ // Knots sequence from [-DegV, IndexV+1] in IGESGeom.
TColStd_Array1OfReal KV(1, NbVPoles + DegV + 1);
mysurface->VKnotSequence(KV);
itampon = -DegV;
itampon++;
}
- // filling Weights array de [0, IndexU, 0, IndexV]
+ // filling Weights array from [0, IndexU, 0, IndexV]
// ----------------------------------------------
Handle(TColStd_HArray2OfReal) Weights = new TColStd_HArray2OfReal(0, IndexU, 0, IndexV);
Standard_Integer WeightRow = Weights->LowerRow();
}
}
- // filling Poles array de [0, IndexU, 0, IndexV]
+ // filling Poles array from [0, IndexU, 0, IndexV]
// ---------------------------------------------
Handle(TColgp_HArray2OfXYZ) Poles = new TColgp_HArray2OfXYZ(0, IndexU, 0, IndexV);
Standard_Integer UIndex = Poles->LowerRow();
}
//=============================================================================
-// Transfer des Entites BezierSurface de Geom vers IGES
+// Transfer of BezierSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
}
//=============================================================================
-// Transfer des Entites RectangularTrimmedSurface de Geom vers IGES
+// Transfer of RectangularTrimmedSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
Handle(Geom_Surface) st = start->BasisSurface();
if (st->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
{
- // message d'erreur pas de trimmed a partir d'une trimmed ,
- // on peut eventuellement ecrire la surface de base : st.
+ // error message no trimmed from a trimmed,
+ // we can possibly write the base surface: st.
return res;
}
}
//=============================================================================
-// Transfer des Entites ElementarySurface de Geom vers IGES
+// Transfer of ElementarySurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
}
//=============================================================================
-// Transfer des Entites Plane de Geom vers IGES
+// Transfer of Plane Entities from Geom to IGES
// TransferSurface
//=============================================================================
const Standard_Real Vdeb,
const Standard_Real Vfin)
{
- // on va ecrire une BSplineSurface pour pouvoir etre coherent avec les courbes 2d
+ // we will write a BSplineSurface to be able to be coherent with 2d curves
Handle(IGESData_IGESEntity) res;
TheLength = 1;
if (start.IsNull())
}
//=============================================================================
-// Transfer des Entites CylindricalSurface de Geom vers IGES
+// Transfer of CylindricalSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
if (Precision::IsPositiveInfinite(Vfin))
V2 = Precision::Infinite();
- // creation de la generatrice : Generatrix
+ // creation of the generatrix : Generatrix
Handle(Geom_Line) Ligne =
new Geom_Line(gp_Pnt(start->Cylinder().Radius(), 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0));
GeomToIGES_GeomCurve GC(*this);
gp_Pnt gen2 = Ligne->Value(V2);
TheLength = gen1.Distance(gen2);
- // creation de l`axe : Axis .
+ // creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
// #30 rln 19.10.98 IGES axis = reversed CAS.CADE axis
// Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
Axis->Init(gp_XYZ(0, 0, 1.), gp_XYZ(0, 0, 0));
Surf->Init(Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1);
- // creation de la Trsf (#124)
- // il faut tenir compte de l`unite pour la matrice de transformation
+ // creation of the Trsf (#124)
+ // we must take into account the unit for the transformation matrix
// (partie translation).
IGESConvGeom_GeomBuilder Build;
Standard_Real xloc, yloc, zloc;
}
//=============================================================================
-// Transfer des Entites ConicalSurface de Geom vers IGES
+// Transfer of ConicalSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
if (Precision::IsPositiveInfinite(Vfin))
V2 = Precision::Infinite();
- // creation de la generatrice : Generatrix
+ // creation of the generatrix : Generatrix
Handle(Geom_Line) Ligne =
new Geom_Line(gp_Pnt(start->Cone().RefRadius(), 0.0, 0.0),
gp_Dir(sin(start->Cone().SemiAngle()), 0., cos(start->Cone().SemiAngle())));
// TheLength = gen1.Distance(gen2)*Cos(start->Cone().SemiAngle());
TheLength = gen1.Distance(gen2);
- // creation de l`axe : Axis .
+ // creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
// #30 rln 19.10.98 IGES axis = reversed CAS.CADE axis
// Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
Axis->Init(gp_XYZ(0, 0, 1.), gp_XYZ(0, 0, 0));
Surf->Init(Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1);
- // creation de la Trsf (#124)
- // il faut tenir compte de l`unite pour la matrice de transformation
+ // creation of the Trsf (#124)
+ // we must take into account the unit for the transformation matrix
// (partie translation).
IGESConvGeom_GeomBuilder Build;
Standard_Real xloc, yloc, zloc;
}
//=============================================================================
-// Transfer des Entites SphericalSurface de Geom vers IGES
+// Transfer of SphericalSurface Entities from Geom to IGES
// TransferSurface
//=============================================================================
Standard_Real V1 = Vdeb;
Standard_Real V2 = Vfin;
- // creation de la generatrice : Generatrix (1/2 cercle)
+ // creation of the generatrix : Generatrix (1/2 cercle)
gp_Ax2 Axe(gp::Origin(), -gp::DY(), gp::DX());
Handle(Geom_Circle) Cercle = new Geom_Circle(Axe, start->Sphere().Radius());
GeomToIGES_GeomCurve GC(*this);
Handle(IGESData_IGESEntity) Gen = GC.TransferCurve(Cercle, V1, V2);
- // creation de l`axe : Axis .
+ // creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
// #30 rln 19.10.98 IGES axis = reversed CAS.CADE axis
// Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
Standard_Real V1 = Vdeb;
Standard_Real V2 = Vfin;
- // creation de la generatrice : Generatrix (cercle)
+ // creation of the generatrix : Generatrix (cercle)
gp_Ax2 Axe = gp_Ax2(gp_Pnt((start->Torus().MajorRadius()), 0., 0.), -gp::DY(), gp::DX());
Handle(Geom_Circle) Cercle = new Geom_Circle(Axe, start->Torus().MinorRadius());
GeomToIGES_GeomCurve GC(*this);
Handle(IGESData_IGESEntity) Gen = GC.TransferCurve(Cercle, V1, V2);
- // creation de l`axe : Axis .
+ // creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
// #30 rln 19.10.98 IGES axis = reversed CAS.CADE axis
// Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit()));
// dans IGES l'origine de la generatrice est identique a l'origine
// de la directrice , il faut translater la courbe si les deux
- // points ne sont pas confondus dans Geom et donc la copier !!!!!!!
+ // points are not coincident in Geom and therefore copy it !!!!!!!
gp_Pnt TheEnd = start->Value(U1, V2);
Standard_Real Xe, Ye, Ze;
TheEnd.Coord(Xe, Ye, Ze);
if (Precision::IsPositiveInfinite(Vfin))
V2 = Precision::Infinite();
- // creation de la generatrice : Generatrix
+ // creation of the generatrix : Generatrix
Handle(Geom_Curve) Curve = start->BasisCurve();
GeomToIGES_GeomCurve GC(*this);
Handle(IGESData_IGESEntity) Generatrix = GC.TransferCurve(Curve, V1, V2);
TheLength = gen1.Distance(gen2);
}
- // creation de l`axe : Axis .
+ // creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
gp_Ax1 Axe = start->Axis();
Standard_Real X1, Y1, Z1, X2, Y2, Z2;
}
//=============================================================================
-// Transfer des Entites Plane de Geom vers IGESSolid
+// Transfer of Plane Entities from Geom to IGESSolid
// TransferPlaneSurface
//=============================================================================
// commercial license or contractual agreement.
// modif du 14/09/95 mjm
-// prise en compte de l'unite choisi par l'utilisateur
-// pour l'ecriture du fichier IGES.
+// taking into account the unit chosen by the user
+// for writing the IGES file.
#include <Geom_Direction.hxx>
#include <Geom_Vector.hxx>
}
//=============================================================================
-// Transfer des Entites Vector de Geom vers IGES
+// Transfer of Vector Entities from Geom to IGES
// TransferVector
//=============================================================================
}
//=============================================================================
-// Transfer des Entites VectorWithMagnitude de Geom vers IGES
+// Transfer of VectorWithMagnitude Entities from Geom to IGES
// TransferVector
//=============================================================================
}
//=============================================================================
-// Transfer des Entites Direction de Geom vers IGES
+// Transfer of Direction Entities from Geom to IGES
// TransferVector
//=============================================================================
Handle(IGESData_LevelListEntity) nulevel;
ent->InitLevel(nulevel, 0);
res = Standard_True;
- } // NbPropertyvalues = 5 + RAZ level selon subordinate
+ } // NbPropertyvalues = 5 + RAZ level according to subordinate
return res;
}
S << "\nResult Data Locations : ";
S << " TO BE DONE ";
- // ?? A VERIFIER DE PRES, pas du tout sur que ce soit bon
- // cf aussi Write et Copy
+ // ?? TO VERIFY CLOSELY, not at all sure this is correct
+ // see also Write and Copy
if (level <= 4)
S << " [ ask level > 4 for more, > 5 for complete ]\n";
else
ent->InitLevel(nulevel, 0);
res = Standard_True;
}
- return res; // nbpropertyvalues = 5 + RAZ level selon subordinate
+ return res; // nbpropertyvalues = 5 + reset level according to subordinate
}
IGESData_DirChecker IGESAppli_ToolLineWidening::DirChecker(
Handle(IGESData_LevelListEntity) nulevel;
ent->InitLevel(nulevel, 0);
}
- return res; // RAZ level selon subordibate
+ return res; // RAZ level according to subordinate
}
IGESData_DirChecker IGESAppli_ToolPinNumber::DirChecker(
ent->InitLevel(nulevel, 0);
res = Standard_True;
}
- return res; // + RAZ level selon subordibate
+ return res; // + RAZ level according to subordinate
}
IGESData_DirChecker IGESAppli_ToolReferenceDesignator::DirChecker(
ent->InitLevel(nulevel, 0);
res = Standard_True;
}
- return res; // + RAZ level selon subordibate
+ return res; // + reset level according to subordinate
}
IGESData_DirChecker IGESAppli_ToolRegionRestriction::DirChecker(
theExtRefFileIdentifier = aFileIdent;
theExtRefEntitySymbName = anExtName;
InitTypeAndForm(416, FormNumber());
- // FormNumber 0-2 : sens pas clair. Pourrait etre 0:Definition 2:Entity
+ // FormNumber 0-2 : meaning not clear. Could be 0:Definition 2:Entity
}
void IGESBasic_ExternalRefFileName::SetForEntity(const Standard_Boolean F)
DeclareAndCast(Geom_Curve, Curve, geom);
DeclareAndCast(Geom_Surface, Surf, geom);
- // On reconnait : Curve et Surface de Geom
- // quid de Point; Geom2d ?
+ // We recognize: Curve and Surface from Geom
+ // what about Point; Geom2d ?
// GeomToIGES_GeomPoint GP;
GeomToIGES_GeomCurve GC;
flf->SetDefault(12);
AddSessionItem(flf, "iges-float-digits-12", Standard_True);
- // -- Sender Product Identification -- (pas un statique ...)
+ // -- Sender Product Identification -- (not a static ...)
Handle(IGESSelect_SetGlobalParameter) set3 = new IGESSelect_SetGlobalParameter(3);
Handle(TCollection_HAsciiString) pa3 =
Interface_Static::Static("write.iges.header.product")->HStringValue();
AddSessionItem(new IGESSelect_UpdateFileName, "iges-update-file-name", Standard_True);
- // -- Receiver -- Acces par Static, ajustable
+ // -- Receiver -- Access by Static, adjustable
Handle(IGESSelect_SetGlobalParameter) set12 = new IGESSelect_SetGlobalParameter(12);
Handle(TCollection_HAsciiString) pa12 =
Interface_Static::Static("write.iges.header.receiver")->HStringValue();
AddSessionItem(pa12, "iges-header-val-receiver");
AddSessionItem(set12, "iges-header-set-receiver", Standard_True);
- // -- Auteur -- acces par Static (demarre par whoami), ajustable
+ // -- Author -- access by Static (started by whoami), adjustable
Handle(IGESSelect_SetGlobalParameter) set21 = new IGESSelect_SetGlobalParameter(21);
Handle(TCollection_HAsciiString) pa21 =
Interface_Static::Static("write.iges.header.author")->HStringValue();
AddSessionItem(pa21, "iges-header-val-author");
AddSessionItem(set21, "iges-header-set-author", Standard_True);
- // -- Compagnie (de l auteur) -- acces par Static, ajustable
+ // -- Company (of the author) -- access by Static, adjustable
Handle(IGESSelect_SetGlobalParameter) set22 = new IGESSelect_SetGlobalParameter(22);
Handle(TCollection_HAsciiString) pa22 =
Interface_Static::Static("write.iges.header.company")->HStringValue();
Handle(Interface_InterfaceModel) IGESControl_Controller::NewModel() const
{
- // On prend un modele qu on prepare avec les statiques enregistres
+ // We take a model that we prepare with registered statics
DeclareAndCast(IGESData_IGESModel, igm, Interface_InterfaceModel::Template("iges"));
IGESData_GlobalSection GS = igm->GlobalSection();
return myAdaptorRead;
}
-// #### TRANSFERT (ECRITURE SHAPE) ####
-// modetrans : 0 <5.1 (groupe de faces), 1 BREP-5.1
+// #### TRANSFER (SHAPE WRITING) ####
+// modetrans : 0 <5.1 (group of faces), 1 BREP-5.1
//=================================================================================================
Handle(IGESData_IGESEntity) ent = model->Entity(i);
if (SH.IsShared(ent) || !actor->Recognize(ent))
continue;
- // on ajoute un traitement pour ne prendre que les entites visibles
+ // add processing to take only visible entities
if (!theReadOnlyVisible || ent->BlankStatus() == 0)
{
theroots.Append(ent);
return theroots.Length();
}
-// #### Reliquat de methodes a reprendre ####
+// #### Remainder of methods to be reworked ####
//=======================================================================
// Function : PrintTransferInfo
DeclareAndCast(Geom_Surface, Surf, geom);
Handle(IGESData_IGESEntity) ent;
- // On reconnait : Curve et Surface de Geom
- // quid de Point; Geom2d ?
+ // We recognize: Curve and Surface from Geom
+ // what about Point; Geom2d ?
// GeomToIGES_GeomPoint GP;
GeomToIGES_GeomCurve GC;
if (!nbEnt)
return Standard_False;
IGESData_IGESWriter IW(myModel);
- // ne pas oublier le mode fnes ... a transmettre a IW
+ // do not forget the fnes mode ... to transmit to IW
IW.SendModel(IGESSelect_WorkLibrary::DefineProtocol());
if (fnes)
IW.WriteMode() = 10;
{
Standard_Integer returned = 0;
- // on recupere le degre
+ // we retrieve the degree
Standard_Integer degree = st->SplineType();
if (degree > 3)
degree = 3;
- // on recupere le nombre de segments.
+ // we retrieve the number of segments.
Standard_Integer nbSegs = st->NbSegments();
if (nbSegs < 1)
return 5; // FAIL : no segment
TColgp_Array1OfPnt bspoles(1, nbSegs * degree + 1);
Standard_Integer ibspole = bspoles.Lower() - 1; // Bspole Index.
- // il faut reparametrer avant de passer dans PLib.
- // on est entre[0, T(i+1)-T(i)] et on veut [0,1]
+ // we need to reparameterize before passing to PLib.
+ // we are between [0, T(i+1)-T(i)] and we want [0,1]
for (i = 1; i <= nbSegs; i++)
{
if (datatype < 1 || datatype > 3 || nb == 0 || (polyline && datatype == 3))
throw Standard_DomainError("IGESConvGeom_GeomBuilder : MakeCopiousData");
- Standard_Integer nbd = datatype + 1; // 1->2 2->3 et 3->6
+ Standard_Integer nbd = datatype + 1; // 1->2 2->3 and 3->6
if (datatype == 3)
nbd = 6;
Handle(TColStd_HArray1OfReal) data = new TColStd_HArray1OfReal(1, nb * nbd);
{
if (thepos.Form() == gp_Identity)
return Standard_True;
- // sinon, regarder de plus pres ...
+ // otherwise, look more closely ...
if (!IsTranslation())
return Standard_False;
if (!thepos.TranslationPart().IsEqual(gp_XYZ(0., 0., 0.), epsl))
{
if (thepos.Form() == gp_Identity || thepos.Form() == gp_Translation)
return Standard_True;
- // sinon, regarder de plus pres ...
+ // otherwise, look more closely ...
Standard_Integer i, j;
for (i = 1; i <= 3; i++)
stmod = new IGESData_DefaultGeneral;
if (speci.IsNull())
speci = new IGESData_DefaultSpecific;
- // et modele template "iges"
+ // and template model "iges"
if (Interface_InterfaceModel::HasTemplate("iges"))
return;
(host.SystemVersion().ToCString());
#endif
- // SendName : nom significatif de la piece transmise par exemple
- // SystemId : c est MDTV etc
- // InterfaceVersion : la version en cours de XSTEP; incluant la plateforme
+ // SendName : significant name of the transmitted part for example
+ // SystemId : it is MDTV etc
+ // InterfaceVersion : the current version of XSTEP; including the platform
char nomsys[100]; int istat; long lstat;
struct utsname infosy;
// new TCollection_HAsciiString (process.UserName());
GS.SetCompanyName(Interface_Static::Static("write.iges.header.company")->HStringValue());
// new TCollection_HAsciiString("Matra Datavision");
- GS.SetIGESVersion(11); // pour IGES-5.3 //gka 19.01.99
+ GS.SetIGESVersion(11); // for IGES-5.3 //gka 19.01.99
GS.SetDraftingStandard(0);
GS.SetLastChangeDate(datestr);
GS.SetApplicationProtocol(new TCollection_HAsciiString("")); // gka 19.01.99
return themodel;
}
-// #### Travaux sur le Header (GlobalSection) ####
+// #### Work on the Header (GlobalSection) ####
Standard_Boolean IGESData_BasicEditor::SetUnitFlag(const Standard_Integer flag)
{
Standard_Real vmm = val * themodel->GlobalSection().CascadeUnit();
// #73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection
// if (Interface_Static::IVal("read.scale.unit") == 1) vmm = vmm * 1000.;
- // vmm est exprime en MILLIMETRES
+ // vmm is expressed in MILLIMETERS
Standard_Integer aFlag = GetFlagByValue(vmm);
return (aFlag > 0) ? SetUnitFlag(aFlag) : Standard_False;
}
theunit = Standard_False;
}
-// #### Travaux globaux sur les entites ####
+// #### Global work on entities ####
void IGESData_BasicEditor::ComputeStatus()
{
Interface_Graph G(themodel, theglib); // gere & memorise UseFlag
G.ResetStatus();
- // 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique
- // Tout le modele est traite, pas de jaloux
+ // 2 phases : first we do an overall calculation. Then we apply
+ // The whole model is processed, no favorites
- // Chaque entite va donner une contribution sur ses descendents propres :
- // pour Subordinate (1 ou 2 cumulables), pour UseFlag (1 a 6 exclusifs)
- // (6 depuis IGES-5.2)
+ // Each entity will give a contribution on its own descendants :
+ // for Subordinate (1 or 2 cumulative), for UseFlag (1 to 6 exclusive)
+ // (6 since IGES-5.2)
- // Pour Subordinate : Drawing et 402 (sauf p-e dimensioned geometry ?) donnent
- // Logical, le reste implique Physical (sur descendants directs propres)
+ // For Subordinate : Drawing and 402 (except maybe dimensioned geometry ?) give
+ // Logical, the rest implies Physical (on direct descendants)
- // Pour UseFlag, un peu plus complique :
- // D une part, les UseFlag se propagent aux descendants directs ou non
- // D autre part les cas sont plus compliques (et pas aussi clairs)
+ // For UseFlag, a bit more complicated :
+ // On one hand, UseFlags propagate to direct descendants or not
+ // On the other hand cases are more complicated (and not as clear)
- // ATTENTION, on ne peut traiter que ce qui se deduit du graphe en s appuyant
- // sur les "IGES Type Number", on n a pas le droit ici d acceder a la
- // description specifique des differents types : traites par AutoCorrect.
- // Exemple : une courbe est 3D ou parametrique 2D(UV), non seulement selon son
- // ascendant, mais selon le role qu elle y joue (ex. pour CurveOnSurface :
+ // WARNING, we can only process what can be deduced from the graph by relying
+ // on "IGES Type Number", we don't have the right here to access the
+ // specific description of different types : handled by AutoCorrect.
+ // Example : a curve is 3D or parametric 2D(UV), not only according to its
+ // ancestor, but according to the role it plays there (ex. for CurveOnSurface :
// CurveUV/Curve3D)
- // Traites actuellement (necessaires) :
- // 1(Annotation), aussi 4(pour maillage). 5(ParamUV) traite par AutoCorrect
+ // Currently handled (necessary) :
+ // 1(Annotation), also 4(for meshing). 5(ParamUV) handled by AutoCorrect
Standard_Integer CN;
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 1; i <= nb; i++)
{
- // Subordinate (sur directs en propre seulement)
+ // Subordinate (on direct descendants only)
Handle(IGESData_IGESEntity) ent = themodel->Entity(i);
Standard_Integer igt = ent->TypeNumber();
Handle(Interface_GeneralModule) gmodule;
Interface_EntityIterator sh = G.Sharings(ent); // Maillage ...
if (sh.NbEntities() > 0)
G.GetFromEntity(ent, Standard_True, 4);
- // UV : voir AutoCorrect des classes concernees (Boundary et CurveOnSurface)
+ // UV : see AutoCorrect of concerned classes (Boundary and CurveOnSurface)
/*
} else if (ent->IsKind(STANDARD_TYPE(IGESGeom_CurveOnSurface))) {
DeclareAndCast(IGESGeom_CurveOnSurface,cos,ent); // Curve UV
}
}
- // A present, on va appliquer tout cela "de force"
- // Seule exception : des UseFlags non nuls deja en place sont laisses
+ // Now, we will apply all this "by force"
+ // Only exception: non-zero UseFlags already in place are left
for (i = 1; i <= nb; i++)
{
Standard_Boolean done = Standard_False;
if (ent.IsNull())
return done;
- // Corrections dans l entete (entites presentes)
- // On ne verifie pas les items "Shared", presents de toute facon
- // Entete : traite par DirChecker pour les cas standard
+ // Corrections in the header (present entities)
+ // We don't check "Shared" items, present anyway
+ // Header : handled by DirChecker for standard cases
/*
linefont = ent->LineFont();
if (!linefont.IsNull() && themodel->Number(linefont) == 0) {
}
*/
- // Corrections dans les Assocs (les Props restent attachees a l Entite)
+ // Corrections in Assocs (Props remain attached to the Entity)
Interface_EntityIterator iter = ent->Associativities();
for (iter.Start(); iter.More(); iter.Next())
{
IMPLEMENT_STANDARD_RTTIEXT(IGESData_ColorEntity, IGESData_IGESEntity)
-// ColorEntity ne sert qu'au controle de type (entite Color du directory part)
+// ColorEntity is only used for type control (Color entity of the directory part)
#include <IGESData_DefSwitch.hxx>
-// DefSwitch : represente une definition, soit vide (-> valeur = 0),
-// soit comme rang dans une table (-> valeur > 0 ce rang),
-// soit comme reference (-> valeur < 0), la reference elle-meme est ailleurs
+// DefSwitch : represents a definition, either empty (-> value = 0),
+// or as rank in a table (-> value > 0 this rank),
+// or as reference (-> value < 0), the reference itself is elsewhere
//=================================================================================================
{
IGESData_DirChecker dc;
return dc;
-} // aucun critere specifique
+} // no specific criteria
void IGESData_DefaultGeneral::OwnCheckCase(const Standard_Integer,
const Handle(IGESData_IGESEntity)&,
const Interface_ShareTool&,
Handle(Interface_Check)&) const
{
-} // aucun critere specifique
+} // no specific criteria
Standard_Boolean IGESData_DefaultGeneral::NewVoid(const Standard_Integer CN,
Handle(Standard_Transient)& entto) const
return;
DeclareAndCast(IGESData_UndefinedEntity, enfr, entfrom);
DeclareAndCast(IGESData_UndefinedEntity, ento, entto);
- // ShallowCopy aura passe DirStatus
- // transmettre les contenus des UndefinedContents
+ // ShallowCopy will have passed DirStatus
+ // transmit the contents of UndefinedContents
Handle(Interface_UndefinedContent) cont = new Interface_UndefinedContent;
cont->GetFromAnother(enfr->UndefinedContent(), TC);
ento->SetNewContent(cont);
- // FreeFormat, encore des choses
+ // FreeFormat, more things
if (enfr->IsKind(STANDARD_TYPE(IGESData_FreeFormatEntity)))
{
DeclareAndCast(IGESData_FreeFormatEntity, enf, entfrom);
#include <stdio.h>
-// Pour Correct :
+// For Correct :
// MGE 23/07/98
-// Chaque critere est par defaut inhibe
+// Each criterion is inhibited by default
//=================================================================================================
IGESData_DirChecker::IGESData_DirChecker()
{
thetype = theform1 = theform2 = 0;
thestructure = thelinefont = thelineweig = thecolor = IGESData_ErrorRef;
- thegraphier = -100; // ne pas tester GraphicsIgnored
- theblankst = thesubordst = theuseflag = thehierst = -100; // ne pas tester
+ thegraphier = -100; // do not test GraphicsIgnored
+ theblankst = thesubordst = theuseflag = thehierst = -100; // do not test
}
//=================================================================================================
{
thetype = atype;
theform1 = 0;
- theform2 = -1; // test de forme inhibe
+ theform2 = -1; // form test inhibited
thestructure = thelinefont = thelineweig = thecolor = IGESData_ErrorRef;
- thegraphier = -100; // ne pas tester GraphicsIgnored
- theblankst = thesubordst = theuseflag = thehierst = -100; // ne pas tester
+ thegraphier = -100; // do not test GraphicsIgnored
+ theblankst = thesubordst = theuseflag = thehierst = -100; // do not test
}
//=================================================================================================
IGESData_DirChecker::IGESData_DirChecker(const Standard_Integer atype, const Standard_Integer aform)
{
thetype = atype;
- theform1 = theform2 = aform; // forme : valeur requise
+ theform1 = theform2 = aform; // form : required value
thestructure = thelinefont = thelineweig = thecolor = IGESData_ErrorRef;
- thegraphier = -100; // ne pas tester GraphicsIgnored
- theblankst = thesubordst = theuseflag = thehierst = -100; // ne pas tester
+ thegraphier = -100; // do not test GraphicsIgnored
+ theblankst = thesubordst = theuseflag = thehierst = -100; // do not test
}
//=================================================================================================
{
thetype = atype;
theform1 = aform1;
- theform2 = aform2; // forme : [...]
+ theform2 = aform2; // form : [...]
thestructure = thelinefont = thelineweig = thecolor = IGESData_ErrorRef;
- thegraphier = -100; // ne pas tester GraphicsIgnored
- theblankst = thesubordst = theuseflag = thehierst = -100; // ne pas tester
+ thegraphier = -100; // do not test GraphicsIgnored
+ theblankst = thesubordst = theuseflag = thehierst = -100; // do not test
}
//=================================================================================================
void IGESData_DirChecker::SetDefault()
{
Structure(IGESData_DefVoid);
-} // Option par defaut
+} // Default option
//=================================================================================================
}
}
- Handle(IGESData_IGESEntity) structure; // par defaut Nulle
+ Handle(IGESData_IGESEntity) structure; // by default Null
if (thestructure != IGESData_DefVoid)
structure = ent->Structure();
Handle(IGESData_ViewKindEntity) nulview;
Handle(IGESData_LineFontEntity) nulfont;
Handle(IGESData_LevelListEntity) nulevel;
Handle(IGESData_ColorEntity) nulcolor;
- Handle(IGESData_LabelDisplayEntity) label; // par defaut Nulle
+ Handle(IGESData_LabelDisplayEntity) label; // by default Null
if (thegraphier != -1)
label = ent->LabelDisplay();
Standard_Integer linew = 0;
thesubs[8] = '\0';
}
-// CString : on modifie leur CONTENU, pas le POINTEUR LUI-MEME
+// CString : we modify their CONTENT, not the POINTER ITSELF
//=================================================================================================
IMPLEMENT_STANDARD_RTTIEXT(IGESData_FreeFormatEntity, IGESData_UndefinedEntity)
-// Donne un acces simple a la constitution d une UndefinedEntity :
-// Methodes de UndefinedContent, + Type & Form, + AddEntities (little gadget)
+// Provides simple access to the constitution of an UndefinedEntity :
+// Methods of UndefinedContent, + Type & Form, + AddEntities (little gadget)
IGESData_FreeFormatEntity::IGESData_FreeFormatEntity() {}
void IGESData_FreeFormatEntity::SetTypeNumber(const Standard_Integer typenum)
void IGESData_FreeFormatEntity::WriteOwnParams(IGESData_IGESWriter& IW) const
{
- // Redefini de UndefinedEntity pour : NegativePointers
+ // Redefined from UndefinedEntity for : NegativePointers
Standard_Integer neg = 0;
Standard_Integer fneg = 0;
if (!thenegptrs.IsNull())
const Handle(IGESData_IGESEntity)&,
Interface_EntityIterator&) const
{
-} // par defaut, rien (redefinissable)
+} // by default, nothing (redefinable)
void IGESData_GeneralModule::CheckCase(const Standard_Integer CN,
const Handle(Standard_Transient)& ent,
DeclareAndCast(IGESData_IGESEntity, enfr, entfrom);
//// ento->Clear();
- // ... Reprendre entete ...
+ // ... Resume header ...
//? ento->InitTypeAndForm (enfr->TypeNumber(), enfr->FormNumber());ShallowCopy
if (enfr->DefLineFont() == IGESData_DefReference)
void IGESData_GeneralModule::OwnDeleteCase(const Standard_Integer,
const Handle(IGESData_IGESEntity)&) const
{
-} // par defaut, rien (redefinissable)
+} // by default, nothing (redefinable)
Handle(TCollection_HAsciiString) IGESData_GeneralModule::Name(const Standard_Integer,
const Handle(Standard_Transient)& ent,
#include <stdio.h>
-// Routines locales copiant une string [l`ideal serait : astr = astr->Copy()]
-// et transformant un CString (Hollerith ou non) en HAsciiString non Holl.
-// et l inverse
+// Local routines copying a string [the ideal would be : astr = astr->Copy()]
+// and transforming a CString (Hollerith or not) to non-Hollerith HAsciiString.
+// and the reverse
static void CopyString(Handle(TCollection_HAsciiString)& astr)
{
if (astr.IsNull())
- return; // ne rien faire si String pas definie !
+ return; // do nothing if String not defined !
Handle(TCollection_HAsciiString) S = new TCollection_HAsciiString("");
S->AssignCat(astr);
astr = S;
IGESData_GlobalSection::IGESData_GlobalSection()
: theSeparator(','),
theEndMark(';'),
- theIntegerBits(32), // simple = entier = 32b, double = 64
+ theIntegerBits(32), // simple = integer = 32b, double = 64
theMaxPower10Single(38),
theMaxDigitsSingle(6),
theMaxPower10Double(308),
theFileName.Nullify();
theSystemId.Nullify();
theInterfaceVersion.Nullify();
- theIntegerBits = 32; // par defaut, simple = entier = 32b, double = 64
+ theIntegerBits = 32; // by default, simple = integer = 32b, double = 64
theMaxPower10Single = 38;
theMaxDigitsSingle = 6;
theMaxPower10Double = 308;
// clang-format on
theDraftingStandard = 0;
theCascadeUnit = UnitsMethods::GetCasCadeLengthUnit();
- theLastChangeDate.Nullify(); // nouveaute 5.1 (peut etre absente)
- theAppliProtocol.Nullify(); // nouveaute 5.3 (peut etre absente)
+ theLastChangeDate.Nullify(); // new in 5.1 (may be absent)
+ theAppliProtocol.Nullify(); // new in 5.3 (may be absent)
Standard_Integer nbp = params->NbParams();
void IGESData_IGESDumper::PrintDNum(const Handle(IGESData_IGESEntity)& ent,
Standard_OStream& S) const
{
- // Affichage garanti sur 12 caracteres 12345/D24689
+ // Display guaranteed on 12 characters 12345/D24689
Standard_Integer num = 0;
if (!ent.IsNull())
{
}
}
- // Donnees attachees : Properties, Associativities, et Sharings
+ // Attached data : Properties, Associativities, and Sharings
if (att < 0)
return;
Interface_EntityIterator iter = ent->Properties();
void IGESData_IGESEntity::Clear()
{
- // Handle et DefSwitch
+ // Handle and DefSwitch
theStructure.Nullify();
theDefLineFont.SetVoid();
theLineFont.Nullify();
return GetCasted(IGESData_LabelDisplayEntity, theLabDisplay);
}
-// Status : un Integer pour BlankStatus,SubrodinateStatus,USeFlag,HierarchySt.
-// Decoupage : 4 bits chacun (BlankStatus tout a droite, etc)
+// Status : an Integer for BlankStatus,SubordinateStatus,UseFlag,HierarchySt.
+// Division : 4 bits each (BlankStatus on the right, etc)
Standard_Integer IGESData_IGESEntity::BlankStatus() const
{
{
if (!HasTransf())
return gp_GTrsf(); // Identite
- // Prendre Location et anuler TranslationPart
+ // Take Location and cancel TranslationPart
gp_GTrsf loca = Transf()->Value(); // c-a-d Compoound
loca.SetTranslationPart(gp_XYZ(0., 0., 0.));
return loca;
static Standard_CString voidline = "";
-// Routine interne utilisee pour VerifyCheck
+// Internal routine used for VerifyCheck
void IGESData_VerifyDate(const Handle(TCollection_HAsciiString)& str,
Handle(Interface_Check)& ach,
const Standard_CString mess);
ach->SendFail(Msg48);
}
- // .. verifie-t-on UnitName en accord avec UnitFlag ?
+ // .. should we verify UnitName in accordance with UnitFlag ?
if (theheader.UnitName().IsNull())
{
// Sending of message : Unit Name parameter is undefined.
Message_Msg Msg52("XSTEP_52");
ach->SendFail(Msg52);
}
- // .. comment verifier les coordonnees max ?
+ // .. how to verify the max coordinates ?
// Sending of message : Version Flag parameter is incorrect.
if (theheader.IGESVersion() < 1
Message_Msg Msg57("XSTEP_57");
// =====================================
- // Attention c est du Hollerith
+ // Warning this is Hollerith format
if (str.IsNull())
{
ach->SendFail(Msg57);
res2,
label,
subs);
- //// thedirs(num) = DP; // verifier si utile
+ //// thedirs(num) = DP; // check if useful
// InitParams(num); gka optimization memory
}
return (num + 1);
}
-// Reference a d'autres entites : c'est a la fois tres simple et problematique
-// Tres simple : une reference a une entite est un numero (dans directory list)
-// qui vaut (2*N-1) si N est le rang vrai de l'entite
-// Problematique : ce numero est un Entier ... rien ne le distingue d'un autre
-// D'ou critere : tout entier impair inferieur a 2*NbRecords PEUT etre une
-// reference ... C'est a chaque entite de faire ensuite son tri ...
-// Attention, une reference peut etre donnee en "Pointeur Negatif"
-// N.B.: DirPart non concernes (lecture specifique assuree par IGESEntity)
+// Reference to other entities: this is both very simple and problematic
+// Very simple: a reference to an entity is a number (in directory list)
+// which equals (2*N-1) if N is the true rank of the entity
+// Problematic: this number is an Integer... nothing distinguishes it from another
+// Hence criterion: any odd integer less than 2*NbRecords CAN be a
+// reference... It's up to each entity to sort it out afterwards...
+// Attention, a reference can be given as "Negative Pointer"
+// N.B.: DirPart not concerned (specific reading ensured by IGESEntity)
void IGESData_IGESReaderData::SetEntityNumbers()
{
- // On essaie de se baser uniquement sur calcul de IGESRead
+ // We try to rely solely on IGESRead calculation
/*
Standard_Integer nbd = thedirs.Upper();
for (Standard_Integer i = 1; i <= nbd; i ++) {
}
// ###########################################################################
-// ######## LECTURE (Controle General) ########
+// ######## READING (General Control) ########
-// (Elements enchaines par la classe de base Interface_FileReaderTool)
+// (Elements chained by the base class Interface_FileReaderTool)
void IGESData_IGESReaderTool::BeginRead(const Handle(Interface_InterfaceModel)& amodel)
{
thedefweight = igesdat->DefaultLineWeight();
}
-// Manquent les procedures de reprise sur erreur en cours de route ...
+// Missing error recovery procedures during the process ...
Standard_Boolean IGESData_IGESReaderTool::AnalyseRecord(const Standard_Integer num,
const Handle(Standard_Transient)& anent,
Handle(Interface_Check)& ach)
DeclareAndCast(IGESData_IGESEntity, ent, anent);
DeclareAndCast(IGESData_IGESReaderData, igesdat, Data());
- // Demarrage de la lecture : Faire Clear
+ // Start of reading : Do Clear
ent->Clear();
- // UndefinedEntity : une pre-analyse est faite
+ // UndefinedEntity : a pre-analysis is done
DeclareAndCast(IGESData_UndefinedEntity, undent, ent);
if (!undent.IsNull())
{
- IGESData_DirPart DP = igesdat->DirPart(num); // qui le copie ...
- undent->ReadDir(igesdat, DP, ach); // DP a pu etre modifie
- ReadDir(ent, igesdat, DP, ach); // Lecture avec ce DP
+ IGESData_DirPart DP = igesdat->DirPart(num); // which copies it ...
+ undent->ReadDir(igesdat, DP, ach); // DP may have been modified
+ ReadDir(ent, igesdat, DP, ach); // Reading with this DP
}
else
ReadDir(ent, igesdat, igesdat->DirPart(num), ach);
thestep = IGESData_ReadDir;
- // Liste de Parametres : controle de son entete
+ // Parameter List : control of its header
// Handle(Interface_ParamList) list = Data()->Params(num);
Standard_Integer nbpar = Data()->NbParams(num);
Standard_Integer n0par = (num == 1 ? 1 : (Data()->ParamFirstRank(num - 1) + 1));
if (nbpar < 1)
{
- // Liste vide non admise, sauf si Undefined (par exemple type nul)
+ // Empty list not allowed, except if Undefined (for example null type)
if (!undent.IsNull())
return Standard_True;
// Sending of message : DE : no parameter
}
// ###########################################################################
-// ######## UNE ENTITE ########
+// ######## ONE ENTITY ########
// ######## Directory Part ########
ent->InitMisc(Structure, Lbd, LWeightNum);
ent->InitDirFieldEntity(8, fieldlab);
- // ignores : 1(type),2(ptrPsect),13(type),16(lignesPsect),17(form)
- // type et forme sont lus directement du DirPart; autres infos recalculees
+ // ignores : 1(type),2(ptrPsect),13(type),16(linesPsect),17(form)
+ // type and form are read directly from DirPart; other info recalculated
- // Restent a analyser nom (short label) et snum (subscript number)
+ // Remaining to analyze name (short label) and snum (subscript number)
Handle(TCollection_HAsciiString) ShortLabel;
Standard_Integer SubScriptN = -1;
Standard_Integer iacar = 0;
SubScriptN = atoi(snum);
ent->SetLabel(ShortLabel, SubScriptN);
- // Enfin, SetLineWeight, tenant compte du defaut
+ // Finally, SetLineWeight, taking into account the default
ent->SetLineWeight(IR->DefaultLineWeight(), themaxweight, thegradweight);
}
Handle(Interface_ReaderModule) imodule;
Standard_Integer CN;
- // Les Modules font tout
+ // The Modules do everything
if (therlib.Select(ent, imodule, CN))
{
Handle(IGESData_ReadWriteModule) module = Handle(IGESData_ReadWriteModule)::DownCast(imodule);
Message_Msg Msg35("XSTEP_35");
Msg35.Arg(thecnum);
ach->SendFail(Msg35);
- // Cas de UndefinedEntity
+ // Case of UndefinedEntity
}
else if (ent->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity)))
{
DeclareAndCast(IGESData_UndefinedEntity, undent, ent);
undent->ReadOwnParams(IR, PR);
- // IGESEntity creee puis non reconnue ... (bizarre, non ?)
+ // IGESEntity created then not recognized ... (strange, isn't it ?)
}
else
{
// #define PATIENCELOG
-// Constructeur complet : taille OK, et se remplit depuis le modele en direct
+// Complete constructor: size OK, and fills from the model directly
IGESData_IGESWriter::IGESData_IGESWriter(const Handle(IGESData_IGESModel)& amodel)
: thedirs(0, amodel->NbEntities()),
thesep = ',';
theendm = ';';
thepars = new TColStd_HSequenceOfHAsciiString();
- thepnum.SetValue(1, 1); // debut des parametres de la 1re entite
+ thepnum.SetValue(1, 1); // start of parameters for the 1st entity
thesect = 0;
thepnum.Init(0);
- // Format flottant : cf FloatWriter
+ // Floating format : see FloatWriter
}
IGESData_IGESWriter::IGESData_IGESWriter()
{
}
-// .... Controle d Envoi des Flottants ....
+// .... Float Sending Control ....
Interface_FloatWriter& IGESData_IGESWriter::FloatWriter()
{
thestar->Append(new TCollection_HAsciiString(startline));
return;
}
- // Trop longue : on passe par bouts
+ // Too long: we go piece by piece
char startchar = startline[MaxcarsG];
pstartline[MaxcarsG] = '\0';
SendStartLine(startline);
if (i % 1000 == 1)
std::cout << "*" << std::flush;
#endif
- // Attention aux cas d erreur : contenu redefini
+ // Watch out for error cases : redefined content
if (themodel->IsRedefinedContent(i))
{
sout << " -- IGESWriter : Erroneous Entity N0." << i << " --" << std::endl;
}
DirPart(cnt);
- OwnParams(ent); // preparation : porte sur le vrai <ent> ...
+ OwnParams(ent); // preparation: applies to the real <ent> ...
- // Envoi proprement dit des Parametres proprement definis
+ // Actual sending of properly defined Parameters
Handle(IGESData_ReadWriteModule) module;
Standard_Integer CN;
- // Differents cas
+ // Different cases
if (lib.Select(cnt, module, CN))
module->WriteOwnParams(CN, cnt, *this);
else if (cnt->IsKind(STANDARD_TYPE(IGESData_UndefinedEntity)))
EndEntity();
}
#ifdef PATIENCELOG
- std::cout << " Envoi des Entites Termine" << std::endl;
+ std::cout << " Entity Sending Finished" << std::endl;
#endif
SectionT();
}
thesep = header.Separator();
theendm = header.EndMark();
thecurr.SetMax(MaxcarsG);
- // Important : les Parametres sont sortis sous leur forme definitive
- // (c-a-d Hollerith pour les Textes ...)
+ // Important : Parameters are output in their final form
+ // (i.e. Hollerith for Texts ...)
Handle(Interface_ParamSet) gl = header.Params();
Standard_Integer nb = gl->NbParams();
for (Standard_Integer i = 1; i <= nb; i++)
if (nument == 0)
return;
IGESData_DirPart& DP = thedirs.ChangeValue(nument);
- // Remplissage du DirPart
+ // Filling the DirPart
v[0] = anent->TypeNumber();
- v[1] = 0; // numero en section P : calcule ulterieurement
+ v[1] = 0; // number in section P: calculated later
if (anent->HasStructure())
v[2] = -themodel->DNum(anent->DirFieldEntity(3));
else
else
v[14] = 0;
- v[15] = 0; // nb lignes section P : calcule plus tard
+ v[15] = 0; // number of lines in section P: calculated later
v[16] = anent->FormNumber();
anent->CResValues(res1, res2);
throw Interface_InterfaceError("IGESWriter : Associativities");
thestep = IGESData_ReadAssocs;
if (!anent->ArePresentAssociativities() && !anent->ArePresentProperties())
- return; // Properties suivent : ne pas les omettre !
+ return; // Properties follow : do not omit them !
Send(anent->NbAssociativities());
for (Interface_EntityIterator iter = anent->Associativities(); iter.More(); iter.Next())
{
thestep = IGESData_ReadEnd;
}
-// .... Alimentation des parametres ....
+// .... Parameter feeding ....
void IGESData_IGESWriter::AddString(const Handle(TCollection_HAsciiString)& val,
const Standard_Integer more)
lnstr = (Standard_Integer)strlen(val);
if (!thecurr.CanGet(lnstr + more + 1))
{
- // + 1 (18-SEP-1996) pour etre sur que le separateur n est pas en tete de ligne
+ // + 1 (18-SEP-1996) to be sure that the separator n is not at the head of line
if (thesect < 3)
thehead->Append(thecurr.Moved());
else
}
Standard_Integer maxcars = (thesect == 3 ? MaxcarsP : MaxcarsG);
Standard_Integer n2 = 0;
- // .. pb de taille limite (30-DEC-1996)
+ // .. size limit issue (30-DEC-1996)
while (lnstr > maxcars)
{
thecurr.Add(&val[n2], lnstr);
void IGESData_IGESWriter::AddChar(const Standard_Character val, const Standard_Integer more)
{
- // 1 seul caractere : cas particulier simplifie
+ // 1 single character : simplified special case
char text[2];
text[0] = val;
text[1] = '\0';
void IGESData_IGESWriter::Send(const Standard_Real val)
{
- // Valeur flottante, expurgee de "0000" qui trainent et de "E+00"
+ // Floating value, purged of trailing "0000" and "E+00"
char lval[24];
AddChar(thesep);
Standard_Integer lng = thefloatw.Write(val, lval);
num = themodel->DNum(val);
if (negative)
num = -num;
- Send(num); // qui faut tout, une fois Entity convertie en Integer
+ Send(num); // which handles everything, once Entity converted to Integer
}
void IGESData_IGESWriter::Send(const gp_XY& val)
void IGESData_IGESWriter::SendString(const Handle(TCollection_HAsciiString)& val)
{
AddChar(thesep);
- AddString(val); // envoi en l etat
+ AddString(val); // send as is
}
// .... Envoi final ....
Standard_Boolean IGESData_IGESWriter::Print(Standard_OStream& S) const
{
- // ATTENTION MODEFNES : si themodew = 10 ... alors on ecrit du FNES
- // quesaco ? fnes = iges + xor sur les caracteres (150,151,152,153,150...)
- // avec en plus une ligne qcq en tete ...
- // donc tous les 4 car.s, on fait un tour de modulo. ainsi a 64 et a 72 ...
- // On a une mini-routine qui ecrit un morceau de texte "en fnes", et les
- // blancs qui sont optimises (quand meme ...)
+ // WARNING MODEFNES : if themodew = 10 ... then we write FNES
+ // what is it? fnes = iges + xor on characters (150,151,152,153,150...)
+ // with additionally some line at the head ...
+ // so every 4 chars, we do a modulo round. thus at 64 and at 72 ...
+ // We have a mini-routine that writes a piece of text "in fnes", and the
+ // blanks that are optimized (anyway ...)
Standard_Boolean isGood = (S.good());
Standard_Boolean fnes = (themodew >= 10);
if (thesect != 4)
throw Interface_InterfaceError("IGESWriter not ready for Print");
- // Start Section (assez simple, somme toute). Attention si commentaires
+ // Start Section (quite simple, all in all). Watch out for comments
Handle(TCollection_HAsciiString) line;
Standard_Integer nbs = 1;
if (thestar.IsNull())
std::cout << "Global Section : " << std::flush;
#endif
isGood = S.good();
- // Global Section : convertie dans <thehead>
+ // Global Section : converted in <thehead>
Standard_Integer nbg = thehead->Length();
for (i = 1; i <= nbg && isGood; i++)
{
res2,
lab,
num);
- v[1] = thepnum.Value(i); // debut en P
- v[15] = thepnum.Value(i + 1) - thepnum.Value(i); // nb de lignes en P
+ v[1] = thepnum.Value(i); // start in P
+ v[15] = thepnum.Value(i + 1) - thepnum.Value(i); // nb of lines in P
sprintf(ligne,
"%8d%8d%8d%8d%8d%8d%8d%8d%2.2d%2.2d%2.2d%2.2dD%7.7d",
v[0],
char finlin[32];
sprintf(finlin, " %7.7dP%7.7d", 2 * i - 1, j);
line = thepars->Value(j);
- // line->LeftJustify(MaxcarsP,' '); remplace par plus economique ! :
+ // line->LeftJustify(MaxcarsP,' '); replaced by more economical ! :
if (fnes)
writefnes(S, line->ToCString());
IMPLEMENT_STANDARD_RTTIEXT(IGESData_LabelDisplayEntity, IGESData_IGESEntity)
-// LabelDisplayEntity ne sert qu'au controle de type (pour le directory part)
+// LabelDisplayEntity is only used for type control (for the directory part)
IMPLEMENT_STANDARD_RTTIEXT(IGESData_LevelListEntity, IGESData_IGESEntity)
-// LevelListEntity ne sert qu'au controle de type (pour le directory part)
+// LevelListEntity is only used for type control (for the directory part)
Standard_Boolean IGESData_LevelListEntity::HasLevelNumber(const Standard_Integer level) const
{
Standard_Integer nb = NbLevelNumbers();
IMPLEMENT_STANDARD_RTTIEXT(IGESData_LineFontEntity, IGESData_IGESEntity)
-// LineTypeEntity ne sert qu'au controle de type (pour le directory part)
+// LineTypeEntity is only used for type control (for the directory part)
IMPLEMENT_STANDARD_RTTIEXT(IGESData_NameEntity, IGESData_IGESEntity)
-// NameEntity sert a decrire des entites "propriete nom" (Value a definir)
+// NameEntity is used to describe entities "name property" (Value to be defined)
theadv = advance;
}
-// LA SUITE : inline , cf lxx
+// THE REST : inline , see lxx
// (Start,Limit,Count,ItemSize,TermSize,Offset,Advance)
#include <stdio.h>
// MGE 03/08/98
-static Standard_Integer testconv = -1; // cf parametre de session
+static Standard_Integer testconv = -1; // see session parameter
// .... Gestion generale (etat, courant ...) ....
thestage = IGESData_ReadEnd;
}
-// .... Acces de base aux parametres ....
+// .... Basic parameter access ....
//=================================================================================================
return GetCasted(IGESData_IGESEntity, IR->BoundEntity(n));
}
-// .... Assistance a la lecture ....
+// .... Reading assistance ....
-// Les fonctions Read* offrent les services suivants :
-// Gestion des erreurs : le Check est alimente, par Fail ou Corrected selon
-// Si Fail, retour de fonction False (peut etre utile), sinon True
-// En outre, un Status est gere (de type enum DataState)
-// (peut etre interroge suite a appel Read* si retour True/False trop court)
+// The Read* functions offer the following services :
+// Error management : the Check is fed, by Fail or Corrected accordingly
+// If Fail, function returns False (may be useful), otherwise True
+// Furthermore, a Status is managed (of type enum DataState)
+// (can be queried following Read* call if True/False return too short)
//
-// Gestion du pointeur courant (sur option, nais elle est mise par defaut) :
-// Les parametres sont designes via un ParmCursor, qui peut etre fabrique par
-// les methodes ad hoc Current et CurrentList, et qui peut demander a avancer
-// le pointeur courant une fois la lecture faite
-// En outre, pour un HArray1, on peut preciser index de depart
+// Current pointer management (optional, but set by default) :
+// Parameters are designated via a ParmCursor, which can be manufactured by
+// the ad hoc methods Current and CurrentList, and which can request to advance
+// the current pointer once reading is done
+// Furthermore, for an HArray1, you can specify starting index
//=================================================================================================
return Standard_True;
}
-// theindex donne le debut de la lecture; tjrs cale sur debut d item
-// thenbterm donne debut a lire dans l item
-// Ainsi, l indice vrai est theindex + thenbterm
-// thenbterm avance par +nb. Quand il a depasse thetermsz, item suivant
-// theindex est lui-meme limite (critere d arret) a themaxind
+// theindex gives the start of reading; always aligned on item start
+// thenbterm gives start to read in the item
+// Thus, the true index is theindex + thenbterm
+// thenbterm advances by +nb. When it has exceeded thetermsz, next item
+// theindex is itself limited (stop criterion) to themaxind
//=================================================================================================
Standard_Integer IGESData_ParamReader::FirstRead(const Standard_Integer nb)
{
- theindex += theoffset; // On se cale d office sur le debut du terme a lire
+ theindex += theoffset; // We automatically align on the start of the term to read
Standard_Integer res = theindex;
thenbterm = nb;
if (thenbterm >= thetermsz)
Standard_Integer res = theindex;
if (theindex >= themaxind)
res = 0;
- thenbterm += nb; // Par Item : en lire thetermsz, puis item suivant
+ thenbterm += nb; // Per Item: read thetermsz, then next item
if (thenbterm >= thetermsz)
{
theindex += theitemsz;
return Standard_False;
}
- // Un Booleen, c est 0/1. Mais on peut tolerer d autres valeurs
- // On peut toujours consulter LastReadStatus apres la lecture pour etre sur
+ // A Boolean is 0/1. But we can tolerate other values
+ // One can always consult LastReadStatus after reading to be sure
Standard_Integer flag = atoi(FP.CValue());
if (flag != 0 && flag != 1)
{
return Standard_False;
}
- // Un Booleen, c est 0/1. Mais on peut tolerer d autres valeurs
- // On peut toujours consulter LastReadStatus apres la lecture pour etre sur
+ // A Boolean is 0/1. But we can tolerate other values
+ // One can always consult LastReadStatus after reading to be sure
Standard_Integer flag = atoi(FP.CValue());
if (flag != 0 && flag != 1)
{
val = GetCasted(IGESData_IGESEntity, IR->BoundEntity(nval));
if (val.IsNull())
return canbenul;
- // Cas du "Nul IGES"
+ // Case of "Null IGES"
if (val->TypeNumber() == 0)
- { // Null ou pas encore rempli ...
+ { // Null or not yet filled ...
if (IR->DirType(nval).Type() == 0)
- { // le vrai critere (un peu cher)
+ { // the real criterion (a bit expensive)
val.Nullify();
if (!canbenul)
{
val = GetCasted(IGESData_IGESEntity, IR->BoundEntity(nval));
if (val.IsNull())
return canbenul;
- // Cas du "Nul IGES"
+ // Case of "Null IGES"
if (val->TypeNumber() == 0)
- { // Null ou pas encore rempli ...
+ { // Null or not yet filled ...
if (IR->DirType(nval).Type() == 0)
- { // le vrai critere (un peu cher)
+ { // the real criterion (a bit expensive)
val.Nullify();
if (!canbenul)
{
}
if (ind == indmax + 1)
{
- } // tableau complet
+ } // complete array
else if (ind == index)
- val.Nullify(); // tableau vide
+ val.Nullify(); // empty array
else
{
- // Trous : ils ont ete elimines, mais le tableau est a retailler
+ // Gaps: they have been eliminated, but the array needs to be resized
Handle(IGESData_HArray1OfIGESEntity) tab = new IGESData_HArray1OfIGESEntity(index, ind - 1);
for (i = index; i < ind; i++)
tab->SetValue(i, val->Value(i));
}
if (ind == indmax + 1)
{
- } // tableau complet
+ } // complete array
else if (ind == index)
- val.Nullify(); // tableau vide
+ val.Nullify(); // empty array
else
{
- // Trous : ils ont ete elimines, mais le tableau est a retailler
+ // Gaps: they have been eliminated, but the array needs to be resized
Handle(IGESData_HArray1OfIGESEntity) tab = new IGESData_HArray1OfIGESEntity(index, ind - 1);
for (i = index; i < ind; i++)
tab->SetValue(i, val->Value(i));
// AddWarning (mess,ssem,"Real with no decimal point (added), 1st rank=%d");
}
}
- // Par convention (pas d enum explicite dans IGES), signifie
- // "reconnu comme flottant mais pas blanc-bleu" c-a-d sans point decimal
- // mais avec exposant (sinon ce serait un entier)
- // -> un message avertissement + on ajoute le point puis on convertit
+ // By convention (no explicit enum in IGES), means
+ // "recognized as floating but not clean" i.e. without decimal point
+ // but with exponent (otherwise it would be an integer)
+ // -> a warning message + we add the point then convert
val = Atof(text);
}
AddWarning(mess, ssem, "Real with no decimal point (added), 1st rank=%d");
}
}
- // Par convention (pas d enum explicite dans IGES), signifie
- // "reconnu comme flottant mais pas blanc-bleu" c-a-d sans point decimal
- // mais avec exposant (sinon ce serait un entier)
- // -> un message avertissement + on ajoute le point puis on convertit
+ // By convention (no explicit enum in IGES), means
+ // "recognized as floating but not clean" i.e. without decimal point
+ // but with exponent (otherwise it would be an integer)
+ // -> a warning message + we add the point then convert
val = Atof(text);
}
thelast = Standard_False;
}
-// .... Gestion courante du statut de lecture ....
+// .... Current reading status management ....
//=================================================================================================
return nulpro;
}
-// TypeNumber : Ici, on reconnait UndefinedEntity (faut bien quelqu un)
+// TypeNumber : Here, we recognize UndefinedEntity (someone has to)
Standard_Integer IGESData_Protocol::TypeNumber(const Handle(Standard_Type)& atype) const
{
#endif
}
-// IGESReaderTool fait tout
+// IGESReaderTool does everything
IMPLEMENT_STANDARD_RTTIEXT(IGESData_SingleParentEntity, IGESData_IGESEntity)
-// SingleParentEntity sert a decrire des entites "associativite parent"
-// (methode Parent a definir)
+// SingleParentEntity is used to describe "parent associativity" entities
+// (Parent method to be defined)
const Handle(IGESData_IGESEntity)&) const
{
return Standard_False;
-} // par defaut, ne fait rien
+} // by default, does nothing
void IGESData_ToolLocation::Load()
{
- // Pour chaque Entite, sauf Transf et Assoc (sauf SingleParent), on considere
- // ses "OwnShared" comme etant dependents
+ // For each Entity, except Transf and Assoc (except SingleParent), we consider
+ // its "OwnShared" as being dependents
Standard_Integer nb = themodel->NbEntities();
for (Standard_Integer i = 1; i <= nb; i++)
{
Handle(IGESData_IGESEntity) ent = themodel->Entity(i);
if (ent->IsKind(STANDARD_TYPE(IGESData_TransfEntity)))
continue;
- // Cas de SingleParentEntity
+ // Case of SingleParentEntity
if (ent->IsKind(STANDARD_TYPE(IGESData_SingleParentEntity)))
{
DeclareAndCast(IGESData_SingleParentEntity, assoc, ent);
continue;
}
if (ent->TypeNumber() == TYPEFORASSOC)
- continue; // Assoc sauf SingleParent
- // Cas courant
- SetOwnAsDependent(ent); // qui opere
+ continue; // Assoc except SingleParent
+ // Current case
+ SetOwnAsDependent(ent); // which operates
}
}
Handle(IGESData_GeneralModule) module = Handle(IGESData_GeneralModule)::DownCast(gmodule);
Interface_EntityIterator list;
module->OwnSharedCase(CN, ent, list);
- // Remarque : en toute rigueur, il faudrait ignorer les entites referencees
- // dont le SubordinateStatus vaut 0 ou 2 ...
- // Question : ce Status est-il toujours bien comme il faut ?
+ // Remark : strictly speaking, we should ignore the referenced entities
+ // whose SubordinateStatus is 0 or 2 ...
+ // Question : is this Status always correct as it should be ?
for (list.Start(); list.More(); list.Next())
SetReference(ent, GetCasted(IGESData_IGESEntity, list.Value()));
}
gp_GTrsf IGESData_ToolLocation::ParentLocation(const Handle(IGESData_IGESEntity)& ent) const
{
- gp_GTrsf locat; // par defaut, identite
+ gp_GTrsf locat; // by default, identity
Handle(IGESData_IGESEntity) parent = Parent(ent);
// Definition recursive
if (!parent.IsNull())
gp_GTrsf IGESData_ToolLocation::EffectiveLocation(const Handle(IGESData_IGESEntity)& ent) const
{
gp_GTrsf locat = ent->Location();
- // Combiner Transf et ParentLocation
- locat.PreMultiply(ParentLocation(ent)); // ne pas se tromper de sens !
+ // Combine Transf and ParentLocation
+ locat.PreMultiply(ParentLocation(ent)); // don't confuse the direction !
return locat;
}
const Standard_Real unit)
{
if (result.Form() != gp_Identity)
- result = gp_Trsf(); // Identite forcee au depart
- // On prend le contenu de <loc>. Attention a l adressage
+ result = gp_Trsf(); // Identity forced at start
+ // We take the content of <loc>. Be careful with addressing
gp_XYZ v1(loc.Value(1, 1), loc.Value(1, 2), loc.Value(1, 3));
gp_XYZ v2(loc.Value(2, 1), loc.Value(2, 2), loc.Value(2, 3));
gp_XYZ v3(loc.Value(3, 1), loc.Value(3, 2), loc.Value(3, 3));
- // A-t-on affaire a une similitude ?
+ // Are we dealing with a similarity ?
Standard_Real m1 = v1.Modulus();
Standard_Real m2 = v2.Modulus();
Standard_Real m3 = v3.Modulus();
- // D abord est-elle singuliere cette matrice ?
+ // First is this matrix singular ?
if (m1 < prec || m2 < prec || m3 < prec)
return Standard_False;
- Standard_Real mm = (m1 + m2 + m3) / 3.; // voici la Norme moyenne, cf Scale
+ Standard_Real mm = (m1 + m2 + m3) / 3.; // here is the average Norm, see Scale
if (Abs(m1 - mm) > prec * mm || Abs(m2 - mm) > prec * mm || Abs(m3 - mm) > prec * mm)
return Standard_False;
v1.Divide(m1);
v3.Divide(m3);
if (Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec)
return Standard_False;
- // Ici, Orthogonale et memes normes. En plus on l a Normee
- // Restent les autres caracteristiques :
+ // Here, Orthogonal and same norms. Plus we normalized it
+ // Remain the other characteristics :
if (Abs(mm - 1.) > prec)
result.SetScale(gp_Pnt(0, 0, 0), mm);
gp_XYZ tp = loc.TranslationPart();
tp.Multiply(unit);
if (tp.X() != 0. || tp.Y() != 0. || tp.Z() != 0.)
result.SetTranslationPart(tp);
- // On isole le cas de l Identite (tellement facile et avantageux)
+ // We isolate the case of Identity (so easy and advantageous)
if (v1.X() != 1. || v1.Y() != 0. || v1.Z() != 0. || v2.X() != 0. || v2.Y() != 1. || v2.Z() != 0.
|| v3.X() != 0. || v3.Y() != 0. || v3.Z() != 1.)
{
- // Pas Identite : vraie construction depuis un Ax3
+ // Not Identity : real construction from an Ax3
gp_Dir d1(v1);
gp_Dir d2(v2);
gp_Dir d3(v3);
IMPLEMENT_STANDARD_RTTIEXT(IGESData_TransfEntity, IGESData_IGESEntity)
-// TransfEntity ne sert que pour controle de Type, et fourniture par Value
-// de la GTrsf correspondante
+// TransfEntity is only used for Type control, and providing by Value
+// the corresponding GTrsf
return Standard_False;
}
-// ReadDir verifie les donnees, s il y a des erreurs les note (status),
-// genere un nouveau DirPart sans ces erreurs, et appelle ReadDir de base
+// ReadDir verifies the data, if there are errors notes them (status),
+// generates a new DirPart without these errors, and calls base ReadDir
//=================================================================================================
Standard_Integer v[17];
Standard_Character res1[9], res2[9], lab[9], subs[9];
- Standard_Integer max = 2 * IR->NbRecords(); // valeur maxi pour DSectNum
+ Standard_Integer max = 2 * IR->NbRecords(); // max value for DSectNum
thedstat = 0;
Handle(IGESData_IGESEntity) anent;
for (i = 0; i < 8; i++)
{
if (subs[i] == '\0')
- break; // fin de ligne
+ break; // end of line
if (subs[i] != ' ' && (subs[i] < 48 || subs[i] > 57))
iapb = Standard_True;
}
subs[i] = ' ';
}
- // ... Fin de cette analyse : si necessaire on reconstruit DP ...
+ // ... End of this analysis : if necessary we rebuild DP ...
if (thedstat == 0)
return Standard_True;
else
}
}
-// Parametres indifferencies : assocs et props ignores
+// Undifferentiated parameters : assocs and props ignored
//=================================================================================================
}
else thecont->AddLiteral (ptyp,new TCollection_HAsciiString(PR.ParamValue(i)));
*/
- // On est TOUJOURS en mode litteral, c est bien plus clair !
+ // We are ALWAYS in literal mode, it's much clearer !
thecont->AddLiteral(ptyp, new TCollection_HAsciiString(PR.ParamValue(i)));
}
PR.SetCurrentNumber(nb + 1);
IMPLEMENT_STANDARD_RTTIEXT(IGESData_ViewKindEntity, IGESData_IGESEntity)
-// ViewKindEntity ne sert qu'au controle de type (entite View du directory part
-// qui peut etre une Vue Simple ou une Liste de Vue
-// Vue Simple doit implementer IsSingle a Standard_True, Liste de Vue a Standard_False
+// ViewKindEntity is only used for type control (View entity in directory part
+// which can be a Simple View or a View List
+// Simple View must implement IsSingle as Standard_True, View List as Standard_False
IMPLEMENT_STANDARD_RTTIEXT(IGESDefs_AttributeTable, IGESData_IGESEntity)
-// ATTENTION ATTENTION : L Appellation "ROW" n est pas reconduite en l etat
-// Le Numero d Attribut est donne en 1er (donc, en colonne du HArray2 et non
-// en ligne), le numero de Colonne en 2e (donc, comme un numero de Ligne)
+// WARNING WARNING : The "ROW" designation is not continued as is
+// The Attribute Number is given first (therefore, in column of HArray2 and not
+// in row), the Column number second (therefore, as a Row number)
IGESDefs_AttributeTable::IGESDefs_AttributeTable() {}
void IGESDefs_AttributeTable::Init(const Handle(TColStd_HArray2OfTransient)& attributes)
const Standard_Integer Rownum,
const Standard_Integer Valuenum) const
{
- return (AttributeAsInteger(Atnum, Rownum, Valuenum) != 0); // raccourci
+ return (AttributeAsInteger(Atnum, Rownum, Valuenum) != 0); // shortcut
}
Standard_Integer IGESDefs_TabularData::ComputedNbPropertyValues() const
{
- return theNbPropertyValues; // pas malin ... a ameliorer
+ return theNbPropertyValues; // not smart ... to improve
}
Standard_Boolean IGESDefs_TabularData::OwnCorrect()
switch (attrValueDataType)
{
case 0: {
- PR.SetCurrentNumber(PR.CurrentNumber() + 1); // passer
- //// attrValue->SetValue(j, NULL); par defaut
+ PR.SetCurrentNumber(PR.CurrentNumber() + 1); // skip
+ //// attrValue->SetValue(j, NULL); by default
break;
}
case 1: {
Standard_Integer atype = ab->AttributeValueDataType(i);
switch (atype)
{
- case 0: //// list2->SetValue(i,k,NULL); par defaut
+ case 0: //// list2->SetValue(i,k,NULL); by default
break;
case 1: {
DeclareAndCast(TColStd_HArray1OfInteger, otherInt, another->AttributeList(i, k));
GetCasted(IGESData_IGESEntity, TC.Transferred(otherEnt->Value(j))));
}
break;
- case 5: ///// list2->SetValue(i,k,NULL); par defaut
+ case 5: ///// list2->SetValue(i,k,NULL); by default
break;
case 6: { // Here item takes value 0 or 1
DeclareAndCast(TColStd_HArray1OfInteger, otherInt, another->AttributeList(i, k));
valuesInd->SetValue(i, tarr);
}
// ?? for (i=1; i<=nbDeps; i++) { }
- // Dependents : definition pas limpide, on accumule tout sur un seul
- // HArray1OfReal, mis en 1re position du HArray1OfHArray1OfReal
- // On y met tous les flottants qui restent
+ // Dependents : definition not clear, we accumulate everything on a single
+ // HArray1OfReal, put in 1st position of the HArray1OfHArray1OfReal
+ // We put all the remaining floats there
Standard_Integer curnum = PR.CurrentNumber();
Standard_Integer nbpars = PR.NbParams();
Standard_Integer nbd = 0;
PR.SetCurrentNumber (curnum+1);
} */
PR.AddWarning("Don't know exactly how to read dependent values ...");
- // ?? a eclaircir
+ // ?? to clarify
DirChecker(ent).CheckTypeAndForm(PR.CCheck(), ent);
ent->Init(nbProps, propType, typesInd, nbValuesInd, valuesInd, valuesDep);
}
theGeoms = allGeoms;
theLeaders = allLeaders;
InitTypeAndForm(228, FormNumber());
- // FormNumber precises the Nature of the Symbol, cf G.14 (0-3 or > 5000)
+ // FormNumber specifies the Nature of the Symbol, see G.14 (0-3 or > 5000)
}
void IGESDimen_GeneralSymbol::SetFormNumber(const Standard_Integer form)
theCenter = arcCenter;
theLeader2 = anotherArrow;
if (!anotherArrow.IsNull())
- InitTypeAndForm(222, 1); // 1 admet aussi Null
+ InitTypeAndForm(222, 1); // 1 also admits Null
else
InitTypeAndForm(222, FormNumber());
}
}
if (ent->Datatype() == 1)
return res;
- // Forcer DataType = 1 -> reconstruire
+ // Force DataType = 1 -> reconstruct
Standard_Integer nb = ent->NbPoints();
if (nb == 0)
- return res; // rien pu faire (est-ce possible ?)
+ return res; // nothing could be done (is this possible?)
Handle(TColgp_HArray1OfXY) pts = new TColgp_HArray1OfXY(1, nb);
for (Standard_Integer i = 1; i <= nb; i++)
pts->SetValue(i, gp_XY(ent->Point(i).X(), ent->Point(i).Y()));
{
if (ent->NbDimensions() == 1)
return Standard_False;
- // forcer NbDimensions a 1 -> reconstruire
+ // force NbDimensions to 1 -> reconstruct
Standard_Integer nb = ent->NbGeometryEntities();
Handle(IGESData_HArray1OfIGESEntity) EntArray = new IGESData_HArray1OfIGESEntity(1, nb);
for (Standard_Integer i = 1; i <= nb; i++)
}
if (ent->NbDimensions() == 1)
return res;
- // Forcer NbDimensions = 1 -> reconstruire
+ // Force NbDimensions = 1 -> reconstruct
Standard_Integer nb = ent->NbGeometries();
Handle(IGESData_HArray1OfIGESEntity) tempGeomEnts = new IGESData_HArray1OfIGESEntity(1, nb);
Handle(TColStd_HArray1OfInteger) tempDimLocFlags = new TColStd_HArray1OfInteger(1, nb);
}
if (ent->Datatype() == 1)
return res;
- // Forcer DataType = 1 -> reconstruire
+ // Force DataType = 1 -> reconstruct
Standard_Integer nb = ent->NbPoints();
if (nb == 0)
- return Standard_False; // rien pu faire (est-ce possible ?)
+ return Standard_False; // nothing could be done (is this possible?)
Handle(TColgp_HArray1OfXY) pts = new TColgp_HArray1OfXY(1, nb);
for (Standard_Integer i = 1; i <= nb; i++)
pts->SetValue(i, gp_XY(ent->Point(i).X(), ent->Point(i).Y()));
}
if (ent->Datatype() == 1)
return res;
- // Forcer DataType = 1 -> reconstruire
+ // Force DataType = 1 -> reconstruct
Standard_Integer nb = ent->NbPoints();
if (nb == 0)
- return Standard_False; // rien pu faire (est-ce possible ?)
+ return Standard_False; // nothing could be done (is this possible?)
Handle(TColgp_HArray1OfXY) pts = new TColgp_HArray1OfXY(1, nb);
for (Standard_Integer i = 1; i <= nb; i++)
pts->SetValue(i, gp_XY(ent->Point(i).X(), ent->Point(i).Y()));
Standard_Boolean IGESDraw_ToolDrawing::OwnCorrect(const Handle(IGESDraw_Drawing)& ent) const
{
- // Vues vides : les supprimer
+ // Empty views: remove them
Standard_Integer i, nb = ent->NbViews();
Standard_Integer nbtrue = nb;
for (i = 1; i <= nb; i++)
viewOrigins->SetValue(nbtrue, ent->ViewOrigin(i).XY());
}
- // Ne pas oublier les annotations ...
+ // Don't forget the annotations ...
Standard_Integer nbanot = ent->NbAnnotations();
Handle(IGESData_HArray1OfIGESEntity) annotations = new IGESData_HArray1OfIGESEntity(1, nbanot);
for (i = 1; i <= nbanot; i++)
else
{
colorValues->SetValue(i, another->ColorValue(i));
- //// colorDefinitions->SetValue( i, NULL ); par defaut
+ //// colorDefinitions->SetValue( i, NULL ); by default
}
if (another->IsFontDefinition(i))
else
{
lineFontValues->SetValue(i, another->LineFontValue(i));
- //// lineFontDefinitions->SetValue( i, NULL ); par defaut
+ //// lineFontDefinitions->SetValue( i, NULL ); by default
}
lineWeights->SetValue(i, another->LineWeightItem(i));
DeclareAndCast(IGESData_ViewKindEntity, tempView, TC.Transferred(another->ViewItem(I)));
tempViewEntities->SetValue(I, tempView);
}
- // Displayed -> Implied : mettre une liste vide par defaut
+ // Displayed -> Implied : set an empty list by default
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->Init(tempViewEntities, tempDisplayEntities);
}
Standard_Boolean IGESDraw_ToolViewsVisible::OwnCorrect(
const Handle(IGESDraw_ViewsVisible)& ent) const
{
- // Les entites affichees doivent referencer <ent>. Elles ont priorite.
+ // The displayed entities must reference <ent>. They have priority.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
const Handle(IGESData_ViewKindEntity)& entcomp = ent;
Standard_Integer tempLineWeight = another->LineWeightItem(I);
tempLineWeights->SetValue(I, tempLineWeight);
}
- // Displayed -> Implied : mettre une liste vide par defaut
+ // Displayed -> Implied : set an empty list by default
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
ent->Init(tempViewEntities,
tempLineFonts,
Standard_Boolean IGESDraw_ToolViewsVisibleWithAttr::OwnCorrect(
const Handle(IGESDraw_ViewsVisibleWithAttr)& ent) const
{
- // Les entites affichees doivent referencer <ent>. Elles ont priorite.
+ // The displayed entities must reference <ent>. They have priority.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
const Handle(IGESData_ViewKindEntity)& entcomp = ent;
// dce 21.01.99 : move of general message to IGESToBRep_Reader
#include <stdio.h>
-// declarations des programmes C de base :
+// declarations of basic C programs:
#include <IGESData_IGESReaderData.hxx>
#include <IGESData_IGESReaderTool.hxx>
#include <IGESData_GeneralModule.hxx>
#include <Interface_Check.hxx>
-// Pour traiter les exceptions :
+// To handle exceptions:
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
-// definition de base, a inclure pour utiliser
+// basic definition, to include for use
#include <IGESFile_Read.hxx>
#include "igesread.h"
// To use Msg class
#include <Message_Msg.hxx>
-// decoupage interne pour faciliter les recuperations d erreurs
-static Standard_Integer recupne, recupnp; // pour affichage en cas de pepin
+// internal breakdown to facilitate error recovery
+static Standard_Integer recupne, recupnp; // for display in case of problem
static Handle(Interface_Check)& checkread()
{
// void IGESFile_Check2 (int mode,char * code, int num, char * str);
// void IGESFile_Check3 (int mode,char * code);
-// Correspondance entre types igesread et types Interface_ParamFile ...
+// Correspondence between igesread types and Interface_ParamFile types ...
static Interface_ParamType LesTypes[10];
-// Nouvelle maniere : Protocol suffit
+// New way: Protocol is sufficient
Standard_Integer IGESFile_Read(char* nomfic,
const Handle(IGESData_IGESModel)& amodel,
return IGESFile_Read(nomfic, amodel, protocol, nulreco, Standard_True);
}
-// Ancienne maniere : avec Recognizer
+// Old way: with Recognizer
Standard_Integer IGESFile_Read(char* nomfic,
const Handle(IGESData_IGESModel)& amodel,
if (result != 0)
return result;
- // Chargement des resultats dans un IGESReader
+ // Loading results into an IGESReader
LesTypes[ArgVide] = Interface_ParamVoid;
LesTypes[ArgQuid] = Interface_ParamMisc;
LesTypes[ArgInt] = Interface_ParamInteger;
LesTypes[ArgSign] = Interface_ParamInteger;
LesTypes[ArgReal] = Interface_ParamReal;
- LesTypes[ArgExp] = Interface_ParamMisc; // exposant pas termine
- LesTypes[ArgRexp] = Interface_ParamReal; // exposant complet
- LesTypes[ArgMexp] = Interface_ParamEnum; // exposant mais pas de point
+ LesTypes[ArgExp] = Interface_ParamMisc; // exponent not finished
+ LesTypes[ArgRexp] = Interface_ParamReal; // complete exponent
+ LesTypes[ArgMexp] = Interface_ParamEnum; // exponent but no decimal point
int nbparts, nbparams;
- iges_stats(&nbparts, &nbparams); // et fait les Initialisations necessaires
+ iges_stats(&nbparts, &nbparams); // and performs necessary initializations
Handle(IGESData_IGESReaderData) IR =
// new IGESData_IGESReaderData (nbparts, nbparams);
new IGESData_IGESReaderData((lesect[3] + 1) / 2, nbparams);
{
OCC_CATCH_SIGNALS
IGESFile_ReadHeader(IR);
- } // fin essai 1 (global)
+ } // end attempt 1 (global)
catch (Standard_Failure const&)
{
// Sending of message : Internal error during the header reading
IGESFile_ReadContent(IR);
// Sending of message : Loaded data
- } // fin essai 2 (entites)
+ } // end attempt 2 (entities)
catch (Standard_Failure const&)
{
// Sending of message : Internal error during the content reading
amodel->SetProtocol(protocol);
iges_finfile(2);
- // A present, le check
+ // Now, the check
// Nb warning in global section.
Standard_Integer nbWarn = checkread()->NbWarnings(), nbFail = checkread()->NbFails();
const Handle(Interface_Check)& oldglob = amodel->GlobalCheck();
return 0;
}
-// Decoupage interne
+// Internal breakdown
void IGESFile_ReadHeader(const Handle(IGESData_IGESReaderData)& IR)
{
Standard_Integer l = 0; // szv#4:S4163:12Mar99 i,j,k not needed
char* parval;
int typarg;
- // d abord les start lines (commentaires)
+ // first the start lines (comments)
// szv#4:S4163:12Mar99 optimized
/*
while ( (j = iges_lirparam(&typarg,&parval)) != 0) {
if (k >= 0 || l > 0) IR->AddStartLine (parval);
l ++;
}
- // puis la Global Section
+ // then the Global Section
iges_setglobal();
while ( (i = iges_lirparam(&typarg,&parval)) != 0) {
IR->AddGlobal(LesTypes[typarg],parval);
IR->AddStartLine(parval);
l++;
}
- // puis la Global Section
+ // then the Global Section
iges_setglobal();
while (iges_lirparam(&typarg, &parval) != 0)
IR->AddGlobal(LesTypes[typarg], parval);
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// Include a utiliser pour appeler IGESFile_Read
+// Include to use for calling IGESFile_Read
#ifndef IGESFile_Read_HeaderFile
#define IGESFile_Read_HeaderFile
#define ArgVide 0
#define ArgQuid 1
#define ArgChar 2
-#define ArgInt 3 /* Entier non signe : peut evoluer vers Real ou Char */
-#define ArgSign 4 /* Entier signe : peut evoluer vers Real */
+#define ArgInt 3 /* Unsigned integer: can evolve to Real or Char */
+#define ArgSign 4 /* Signed integer: can evolve to Real */
#define ArgReal 5
-#define ArgExp 6 /* Real + lettre E : attendre confirmation */
-#define ArgRexp 7 /* Real + Exposant : se ramene a Real */
-#define ArgMexp 8 /* Real + Exposant INCOMPLET (pas de point decimal) */
+#define ArgExp 6 /* Real + letter E: wait for confirmation */
+#define ArgRexp 7 /* Real + Exponent: reduces to Real */
+#define ArgMexp 8 /* Real + INCOMPLETE Exponent (no decimal point) */
-/* les structures de travail de structiges sont connues :
- a savoir declarations + curp */
+/* the working structures of structiges are known:
+ namely declarations + curp */
/* #define VERIFPRINT */
-/* Lecture section D
- Chaque entite tient sur deux lignes
+/* Reading section D
+ Each entity spans two lines
- Dstat demarre a zero "on lit une nouvelle entite"
- et bascule avec un "deuxieme ligne de l'entite"
+ Dstat starts at zero "we read a new entity"
+ and switches with a "second line of the entity"
*/
static int bases[] =
{ 1,10,100,1000,10000,100000,1000000, 10000000,100000000,1000000000 };
-/* DECODAGE : parce que scanf ne fait pas vraiment ce qu'il faut */
-/* Utilitaire decodant un nombre en format fixe dans une ligne
- Il part de "depuis" inclus (debut ligne = 0) et prend "tant" caracteres
- Valeur lue en retour de fonction */
-static int IGES_decode (char* ligne, int depuis, int tant)
+/* DECODING: because scanf doesn't really do what's needed */
+/* Utility decoding a number in fixed format in a line
+ It starts from "depuis" included (line start = 0) and takes "tant" characters
+ Value read as function return */
+static int IGES_decode (char* line, int depuis, int tant)
{
int val = 0; int i;
int depart = depuis+tant-1;
for (i = 0; i < tant; i ++) {
- char uncar = ligne[depart-i];
+ char uncar = line[depart-i];
if (uncar == ' ') break;
else if (uncar == '+') continue;
else if (uncar == '-') val = -val;
return val;
}
-/* Recopie d'une chaine de caracteres de longueur fixe (close par \0) */
-void IGES_copstr(char *ligne, int depuis, int tant, char* dans)
+/* Copy of a fixed-length character string (closed by \0) */
+void IGES_copstr(char *line, int depuis, int tant, char* dans)
{
int i;
- for (i = 0; i < tant; i ++) { dans[i] = ligne[depuis+i]; }
+ for (i = 0; i < tant; i ++) { dans[i] = line[depuis+i]; }
dans[tant] = '\0';
}
-/* Analyse section D */
-void iges_Dsect (int *Dstat, int numsec, char* ligne)
+/* Analysis section D */
+void iges_Dsect (int *Dstat, int numsec, char* line)
{
struct dirpart *curp;
if (*Dstat == 0) {
iges_newpart(numsec);
curp = iges_get_curp();
- curp->typ = IGES_decode(ligne, 0,8);
- curp->poi = IGES_decode(ligne, 8,8);
- curp->pdef = IGES_decode(ligne,16,8);
- curp->tra = IGES_decode(ligne,24,8);
- curp->niv = IGES_decode(ligne,32,8);
- curp->vue = IGES_decode(ligne,40,8);
- curp->trf = IGES_decode(ligne,48,8);
- curp->aff = IGES_decode(ligne,56,8);
- curp->blk = IGES_decode(ligne,64,2);
- curp->sub = IGES_decode(ligne,66,2);
- curp->use = IGES_decode(ligne,68,2);
- curp->her = IGES_decode(ligne,70,2);
+ curp->typ = IGES_decode(line, 0,8);
+ curp->poi = IGES_decode(line, 8,8);
+ curp->pdef = IGES_decode(line,16,8);
+ curp->tra = IGES_decode(line,24,8);
+ curp->niv = IGES_decode(line,32,8);
+ curp->vue = IGES_decode(line,40,8);
+ curp->trf = IGES_decode(line,48,8);
+ curp->aff = IGES_decode(line,56,8);
+ curp->blk = IGES_decode(line,64,2);
+ curp->sub = IGES_decode(line,66,2);
+ curp->use = IGES_decode(line,68,2);
+ curp->her = IGES_decode(line,70,2);
#ifdef VERIFPRINT
- printf("Entite %d : type %d ->P %d\n",numsec,typ,poi);
+ printf("Entity %d : type %d ->P %d\n",numsec,typ,poi);
#endif
*Dstat = 1;
} else if (*Dstat == 1) {
curp = iges_get_curp();
- curp->typ2 = IGES_decode(ligne, 0,8);
- curp->epa = IGES_decode(ligne, 8,8);
- curp->col = IGES_decode(ligne,16,8);
- curp->nbl = IGES_decode(ligne,24,8);
- curp->form = IGES_decode(ligne,32,8);
- IGES_copstr (ligne,40,8,curp->res1);
- IGES_copstr (ligne,48,8,curp->res2);
- IGES_copstr (ligne,56,8,curp->nom);
- IGES_copstr (ligne,64,8,curp->num);
+ curp->typ2 = IGES_decode(line, 0,8);
+ curp->epa = IGES_decode(line, 8,8);
+ curp->col = IGES_decode(line,16,8);
+ curp->nbl = IGES_decode(line,24,8);
+ curp->form = IGES_decode(line,32,8);
+ IGES_copstr (line,40,8,curp->res1);
+ IGES_copstr (line,48,8,curp->res2);
+ IGES_copstr (line,56,8,curp->nom);
+ IGES_copstr (line,64,8,curp->num);
#ifdef VERIFPRINT
- printf("Entite %d : type %d (redite) form %d\n",numsec,typ2,form);
+ printf("Entity %d : type %d (redite) form %d\n",numsec,typ2,form);
#endif
*Dstat = 0;
}
}
-/* Lecture section P : preanalyse
- Extraction du numero D et troncature a 64 caracteres */
+/* Reading section P: pre-analysis
+ Extraction of D number and truncation to 64 characters */
-void iges_Psect (int numsec, char ligne[80])
+void iges_Psect (int numsec, char line[80])
{
int dnum;
- dnum = atoi(&ligne[65]);
- ligne[64] = '\0';
+ dnum = atoi(&line[65]);
+ line[64] = '\0';
iges_curpart(dnum);
#ifdef VERIFPRINT
- printf("Entite P:%d ->D:%d,soit %s\n",numsec,dnum,ligne);
+ printf("Entity P:%d ->D:%d,soit %s\n",numsec,dnum,line);
#else
(void)numsec; // just to avoid warning
#endif
}
-/* Depiautage ligne section P (ou G)
- Fractionnement en parametres
- Separes par Separateur courant (c_separ), de fin (c_fin), plus
- traitement des caracteres sous forme Hollerith ... (nnnH...)
+/* Parsing line section P (or G)
+ Parameter breakdown
+ Separated by current Separator (c_separ), end (c_fin), plus
+ character processing in Hollerith form ... (nnnH...)
- Pstat entree : 0 debut entite, 1 debut ligne, 2 courant, 3 pas fini(H)
- Pstat retour : 0 fin entite, 1 fin ligne, 2 courant (en voila un), 3
- pas fini (un nnnH... pas termine)
+ Pstat input : 0 entity start, 1 line start, 2 current, 3 not finished(H)
+ Pstat return : 0 entity end, 1 line end, 2 current (here's one), 3
+ not finished (a nnnH... not finished)
*/
static int nbcarH = 0; static int numcar = 0; static int reste = 0;
-/* reste : 0 cas normal; 1 completer parametre; -1 le sauter */
+/* reste: 0 normal case; 1 complete parameter; -1 skip it */
static int typarg;
-/* + definitions des types de parametres en tete */
+/* + parameter type definitions at head */
-void iges_param (int *Pstat, char *ligne, char c_separ, char c_fin, int lonlin)
+void iges_param (int *Pstat, char *line, char c_separ, char c_fin, int lonlin)
{
int i,i0,j; char param[80]; char unpar;
if (*Pstat == 0) reste = 0;
else {
numcar = nbcarH;
if (numcar > lonlin) {
- iges_addparam(lonlin,ligne);
+ iges_addparam(lonlin,line);
nbcarH -= lonlin; /* ??? enregistrer ... ??? */
return;
} else {
- iges_addparam(nbcarH,ligne);
+ iges_addparam(nbcarH,line);
nbcarH = 0;
}
}
- i0 = 0; /* debut param utile (apres blancs eventuels), par defaut a 0 */
+ i0 = 0; /* useful param start (after possible blanks), default to 0 */
typarg = ArgVide;
- for (i = 0; (unpar = ligne[numcar+i]) != '\0'; i ++) {
+ for (i = 0; (unpar = line[numcar+i]) != '\0'; i ++) {
if (unpar == c_separ) {
*Pstat = 2; param[i] = '\0';
#ifdef VERIFPRINT
if (reste == 0) iges_newparam(typarg,i-i0+1,¶m[i0]);
else if (reste > 0) iges_addparam(i-i0+1,¶m[i0]);
reste = 0;
- for (j = i+1; (unpar = ligne[numcar+j]) != '\0'; j++) {
+ for (j = i+1; (unpar = line[numcar+j]) != '\0'; j++) {
if (unpar != ' ') { numcar += i+1; return; }
}
*Pstat = 1; return;
}
param[i] = unpar;
-/* Type du parametre ? */
+/* Parameter type ? */
if (unpar > 47 && unpar < 58) {
if (typarg == ArgInt) continue;
if (param[j] > 47 && param[j] < 58) nbcarH = nbcarH*10 + (param[j]-48);
else { nbcarH = 0; break; }
}
- if (numcar+i+nbcarH >= lonlin) { /* texte a cheval sur +ieurs lignes */
- for (j = 1; j < lonlin-numcar-i; j++) param[i+j] = ligne[numcar+i+j];
+ if (numcar+i+nbcarH >= lonlin) { /* text spanning multiple lines */
+ for (j = 1; j < lonlin-numcar-i; j++) param[i+j] = line[numcar+i+j];
param[lonlin-numcar] = '\0';
nbcarH = (numcar+i +nbcarH+1 -lonlin);
*Pstat =3;
reste = 1;
return;
} else {
- for (j = 1; j <= nbcarH; j++) param[i+j] = ligne[numcar+i+j];
+ for (j = 1; j <= nbcarH; j++) param[i+j] = line[numcar+i+j];
i += nbcarH;
}
}
-/* blanc : leading (facile) ou trailing (chercher la suite), sinon mauvais */
+/* blank : leading (easy) or trailing (look for continuation), otherwise bad */
else if (unpar == ' ') {
if (typarg == ArgVide) i0 = i+1;
else {
- for (j = i+1; (unpar = ligne[numcar+j]) != '\0' ; j ++) {
+ for (j = i+1; (unpar = line[numcar+j]) != '\0' ; j ++) {
if (unpar == c_separ || unpar == c_fin) break;
if (unpar != ' ') { typarg = ArgQuid; break; }
}
}
}
- else typarg = ArgQuid; /* caractere non reconnu */
+ else typarg = ArgQuid; /* unrecognized character */
}
-/* Ici, fin de ligne sans separateur : noter parametre en cours ! */
+/* Here, end of line without separator : note current parameter ! */
*Pstat = 1; param[i] = '\0'; reste = -1;
#ifdef VERIFPRINT
- printf ("Fin de ligne sans separateur, numcar,i : %d %d\n",numcar,i);
+ printf ("End of line without separator, numcar,i : %d %d\n",numcar,i);
if (i > i0) printf("numcar = %d type %d param: %s ",numcar,typarg,¶m[i0]);
#endif
if (i > i0) iges_newparam(typarg,i-i0+1,¶m[i0]);
commercial license or contractual agreement.
*/
-/* Regroupement des sources "C" pour compilation */
+/* Grouping of "C" sources for compilation */
#include <stdio.h>
#include "igesread.h"
#include <OSD_OpenFile.hxx>
void IGESFile_Check3 (int mode,char * code);
void IGESFile_Check2 (int mode,char * code, int num, char * str);
-/* #include "structiges.c" ... fait par analiges qui en a l'usage ... */
+/* #include "structiges.c" ... done by analiges which uses it ... */
void iges_initfile();
int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes);
void iges_newparam(int typarg,int longval, char *parval);
-/* Routine de lecture generale d'un fichier IGES
- Assure l'enchainement des appels necessaires
- Il en resulte un ensemble de donnees (struct C) interrogeables par
- routines ad hoc (cf igesread.h qui les recapitule pour appel par C++)
+/* General reading routine for an IGES file
+ Ensures the chaining of necessary calls
+ Results in a set of data (struct C) queryable by
+ ad hoc routines (see igesread.h which summarizes them for C++ call)
- Retourne : 0 si OK, 1 si fichier pas pu etre ouvert
+ Returns: 0 if OK, 1 if file could not be opened
*/
lefic = stdin; i0 = numsec = 0; numl = 0;
if (nomfic[0] != '\0')
lefic = OSD_OpenFile(nomfic,"r");
- if (lefic == NULL) return -1; /* fichier pas pu etre ouvert */
+ if (lefic == NULL) return -1; /* file could not be opened */
for (i = 1; i < 6; i++) lesect[i] = 0;
for (j = 0; j < 100; j++) ligne[j] = 0;
for(;;) {
if (i == 2) { /* Header (Global sect) */
iges_setglobal();
for (;;) {
- if (lesect[i] == 1) { /* Separation specifique */
+ if (lesect[i] == 1) { /* Specific separation */
int n0 = 0;
if (ligne[0] != ',') { c_separ = ligne[2]; n0 = 3; }
if (ligne[n0+1] != c_separ) { c_fin = ligne[n0+3]; }
}
}
if (i == 3) iges_Dsect(&Dstat,numsec,ligne); /* Directory (Dsect) */
- if (i == 4) { /* Parametres (Psect) */
+ if (i == 4) { /* Parameters (Psect) */
iges_Psect(numsec,ligne);
for (;;) {
iges_param(&Pstat,ligne,c_separ,c_fin,64);
commercial license or contractual agreement.
*/
-/* Appel externe aux routines de lecture (en C) */
+/* External call to reading routines (in C) */
#include <stdio.h>
/* structiges : */
struct dirpart
{
- int typ, poi, pdef, tra, niv, vue, trf, aff, blk, sub, use, her; /* ligne 1 */
- int typ2, epa, col, nbl, form; /* ligne 2 */
+ int typ, poi, pdef, tra, niv, vue, trf, aff, blk, sub, use, her; /* line 1 */
+ int typ2, epa, col, nbl, form; /* line 2 */
char res1[10], res2[10], nom[10], num[10];
- struct parlist list; /* liste Psect */
+ struct parlist list; /* Psect list */
int numpart; /* n0 en Dsect */
};
struct dirpart* iges_get_curp(void);
void iges_initfile();
- int iges_lire(FILE* lefic, int* numsec, char ligne[100], int modefnes);
+ int iges_lire(FILE* lefic, int* numsec, char line[100], int modefnes);
void iges_newparam(int typarg, int longval, char* parval);
- void iges_param(int* Pstat, char* ligne, char c_separ, char c_fin, int lonlin);
- void iges_Dsect(int* Dstat, int numsec, char* ligne);
- void iges_Psect(int numsec, char ligne[80]);
+ void iges_param(int* Pstat, char* line, char c_separ, char c_fin, int lonlin);
+ void iges_Dsect(int* Dstat, int numsec, char* line);
+ void iges_Psect(int numsec, char line[80]);
/* MGE 20/07/98 */
void IGESFile_Check2(int mode, char* code, int num, char* str);
}
#endif
-/* Definition des types de parametres de l'analyseur de base IGES */
+/* Definition of parameter types for the basic IGES analyzer */
#define ArgVide 0
#define ArgQuid 1
#define ArgChar 2
-#define ArgInt 3 /* Entier non signe : peut evoluer vers Real ou Char */
-#define ArgSign 4 /* Entier signe : peut evoluer vers Real */
+#define ArgInt 3 /* Unsigned integer: can evolve to Real or Char */
+#define ArgSign 4 /* Signed integer: can evolve to Real */
#define ArgReal 5
-#define ArgExp 6 /* Real + lettre E : attendre confirmation */
-#define ArgRexp 7 /* Real + Exposant : se ramene a Real */
-#define ArgMexp 8 /* Real + Exposant INCOMPLET (pas de point decimal) */
+#define ArgExp 6 /* Real + letter E: wait for confirmation */
+#define ArgRexp 7 /* Real + Exponent: reduces to Real */
+#define ArgMexp 8 /* Real + INCOMPLETE Exponent (no decimal point) */
#include "igesread.h"
#include <string.h>
-/* Routine de base de lecture d'un fichier IGES
+/* Basic routine for reading an IGES file
- Cette routine lit une ligne, sauf si le statut "relire sur place" est mis
- (utilise pour changement de section) : il est reannule ensuite
+ This routine reads a line, except if the "re-read in place" status is set
+ (used for section change): it is reset afterwards
- Cette routine retourne :
- - statut (retour fonction) : no de section : S,G,D,P,T (car 73) ou
- 0 (EOF) ou -1 (tacher de sauter) ou -2 (car. 73 faux)
- - un numero de ligne dans la section (car. 74 a 80)
- - la ligne tronquee a 72 caracteres (0 binaire dans le 73ieme)
- Il faut lui fournir (buffer) une ligne reservee a 81 caracteres
+ This routine returns:
+ - status (function return): section no: S,G,D,P,T (char 73) or
+ 0 (EOF) or -1 (try to skip) or -2 (char 73 false)
+ - a line number in the section (char 74 to 80)
+ - the line truncated to 72 characters (binary 0 in the 73rd)
+ Must provide it (buffer) a line reserved for 81 characters
- Cas d erreur : ligne fausse des le debut -> abandon. Sinon tacher d enjamber
+ Error case: false line from the start -> abort. Otherwise try to step over
*/
static int iges_fautrelire = 0;
-int iges_lire (FILE* lefic, int *numsec, char ligne[100], int modefnes)
-/*int iges_lire (lefic,numsec,ligne,modefnes)*/
-/*FILE* lefic; int *numsec; char ligne[100]; int modefnes;*/
+int iges_lire (FILE* lefic, int *numsec, char line[100], int modefnes)
+/*int iges_lire (lefic,numsec,line,modefnes)*/
+/*FILE* lefic; int *numsec; char line[100]; int modefnes;*/
{
int i,result; char typesec;
/* int length;*/
if (iges_fautrelire == 0)
{
if (*numsec == 0)
- ligne[72] = ligne[79] = ' ';
+ line[72] = line[79] = ' ';
- ligne[0] = '\0';
+ line[0] = '\0';
if(modefnes)
{
- if (fgets(ligne,99,lefic) == NULL) /*for kept compatibility with fnes*/
+ if (fgets(line,99,lefic) == NULL) /*for kept compatibility with fnes*/
return 0;
}
else
{
/* PTV: 21.03.2002 it is necessary for files that have only `\r` but no `\n`
example file is 919-001-T02-04-CP-VL.iges */
- while ( fgets ( ligne, 2, lefic ) && ( ligne[0] == '\r' || ligne[0] == '\n' ) )
+ while ( fgets ( line, 2, lefic ) && ( line[0] == '\r' || line[0] == '\n' ) )
{
}
- if (fgets(&ligne[1],80,lefic) == NULL)
+ if (fgets(&line[1],80,lefic) == NULL)
return 0;
}
- if (*numsec == 0 && ligne[72] != 'S' && ligne[79] == ' ')
- {/* ON A DU FNES : Sauter la 1re ligne */
- ligne[0] = '\0';
+ if (*numsec == 0 && line[72] != 'S' && line[79] == ' ')
+ {/* WE HAVE FNES: Skip the 1st line */
+ line[0] = '\0';
if(modefnes)
{
- if (fgets(ligne,99,lefic) == NULL) /*for kept compatibility with fnes*/
+ if (fgets(line,99,lefic) == NULL) /*for kept compatibility with fnes*/
return 0;
}
else
{
- while ( fgets ( ligne, 2, lefic ) && ( ligne[0] == '\r' || ligne[0] == '\n' ) )
+ while ( fgets ( line, 2, lefic ) && ( line[0] == '\r' || line[0] == '\n' ) )
{
}
- if (fgets(&ligne[1],80,lefic) == NULL)
+ if (fgets(&line[1],80,lefic) == NULL)
return 0;
}
}
- if ((ligne[0] & 128) && modefnes)
+ if ((line[0] & 128) && modefnes)
{
for (i = 0; i < 80; i ++)
- ligne[i] = (char)(ligne[i] ^ (150 + (i & 3)));
+ line[i] = (char)(line[i] ^ (150 + (i & 3)));
}
}
return 0;
{//0x1A is END_OF_FILE for OS DOS and WINDOWS. For other OS we set this rule forcefully.
- char *fc = strchr(ligne, 0x1A);
+ char *fc = strchr(line, 0x1A);
if(fc != 0)
{
fc[0] = '\0';
}
iges_fautrelire = 0;
- if (ligne[0] == '\0' || ligne[0] == '\n' || ligne[0] == '\r')
- return iges_lire(lefic,numsec,ligne,modefnes); /* 0 */
+ if (line[0] == '\0' || line[0] == '\n' || line[0] == '\r')
+ return iges_lire(lefic,numsec,line,modefnes); /* 0 */
- if (sscanf(&ligne[73],"%d",&result) != 0) {
+ if (sscanf(&line[73],"%d",&result) != 0) {
*numsec = result;
- typesec = ligne[72];
+ typesec = line[72];
switch (typesec) {
- case 'S' : ligne[72] = '\0'; return (1);
- case 'G' : ligne[72] = '\0'; return (2);
- case 'D' : ligne[72] = '\0'; return (3);
- case 'P' : ligne[72] = '\0'; return (4);
- case 'T' : ligne[72] = '\0'; return (5);
+ case 'S' : line[72] = '\0'; return (1);
+ case 'G' : line[72] = '\0'; return (2);
+ case 'D' : line[72] = '\0'; return (3);
+ case 'P' : line[72] = '\0'; return (4);
+ case 'T' : line[72] = '\0'; return (5);
default :;
}
/* the column 72 is empty, try to check the neighbour*/
- if(strlen(ligne)==80
- && (ligne[79]=='\n' || ligne[79]=='\r') && (ligne[0]<='9' && ligne[0]>='0')) {
+ if(strlen(line)==80
+ && (line[79]=='\n' || line[79]=='\r') && (line[0]<='9' && line[0]>='0')) {
/*check in case of loss.*/
int index;
- for(index = 1; ligne[index]<='9' && ligne[index]>='0'; index++);
- if (ligne[index]=='D' || ligne[index]=='d') {
+ for(index = 1; line[index]<='9' && line[index]>='0'; index++);
+ if (line[index]=='D' || line[index]=='d') {
for(index = 79; index > 0; index--)
- ligne[index] = ligne[index-1];
- ligne[0]='.';
+ line[index] = line[index-1];
+ line[0]='.';
}
- typesec = ligne[72];
+ typesec = line[72];
switch (typesec) {
- case 'S' : ligne[72] = '\0'; return (1);
- case 'G' : ligne[72] = '\0'; return (2);
- case 'D' : ligne[72] = '\0'; return (3);
- case 'P' : ligne[72] = '\0'; return (4);
- case 'T' : ligne[72] = '\0'; return (5);
+ case 'S' : line[72] = '\0'; return (1);
+ case 'G' : line[72] = '\0'; return (2);
+ case 'D' : line[72] = '\0'; return (3);
+ case 'P' : line[72] = '\0'; return (4);
+ case 'T' : line[72] = '\0'; return (5);
default :;
}
}
// the line is not conform to standard, try to read it (if there are some missing spaces)
// find the number end
- i = (int)strlen(ligne);
- while ((ligne[i] == '\0' || ligne[i] == '\n' || ligne[i] == '\r' || ligne[i] == ' ') && i > 0)
+ i = (int)strlen(line);
+ while ((line[i] == '\0' || line[i] == '\n' || line[i] == '\r' || line[i] == ' ') && i > 0)
i--;
- if (i != (int)strlen(ligne))
- ligne[i + 1] = '\0';
+ if (i != (int)strlen(line))
+ line[i + 1] = '\0';
// find the number start
- while (ligne[i] >= '0' && ligne[i] <= '9' && i > 0)
+ while (line[i] >= '0' && line[i] <= '9' && i > 0)
i--;
- if (sscanf(&ligne[i + 1],"%d",&result) == 0)
+ if (sscanf(&line[i + 1],"%d",&result) == 0)
return -1;
*numsec = result;
// find type of line
- while (ligne[i] == ' ' && i > 0)
+ while (line[i] == ' ' && i > 0)
i--;
- typesec = ligne[i];
+ typesec = line[i];
switch (typesec) {
- case 'S' : ligne[i] = '\0'; return (1);
- case 'G' : ligne[i] = '\0'; return (2);
- case 'D' : ligne[i] = '\0'; return (3);
- case 'P' : ligne[i] = '\0'; return (4);
- case 'T' : ligne[i] = '\0'; return (5);
- default :; /* printf("Ligne incorrecte, ignoree n0.%d :\n%s\n",*numl,ligne); */
+ case 'S' : line[i] = '\0'; return (1);
+ case 'G' : line[i] = '\0'; return (2);
+ case 'D' : line[i] = '\0'; return (3);
+ case 'P' : line[i] = '\0'; return (4);
+ case 'T' : line[i] = '\0'; return (5);
+ default :; /* printf("Incorrect line, ignored n0.%d :\n%s\n",*numl,line); */
}
return -1;
}
-/* Pour commander la relecture sur place */
+/* To control re-reading in place */
void iges_arelire()
{ iges_fautrelire = 1; }
#include "igesread.h"
-/* Structures temporaires IGES (enregistrement des entites et parametres)
- Comprennent : les declarations, et la gestion de l'entite en cours */
+/* Temporary IGES structures (recording entities and parameters)
+ Include: declarations, and management of the current entity */
static int nbparts;
static int nbparams;
-/* Liste de parametres IGES (header ou current part) */
+/* IGES parameter list (header or current part) */
static struct parlist *curlist;
-static struct parlist *starts; /* Start Section du fichier IGES */
-static struct parlist *header; /* Entete du fichier IGES */
+static struct parlist *starts; /* Start Section of IGES file */
+static struct parlist *header; /* Header of IGES file */
-/* Declaration d'une portion de Directory IGES */
+/* Declaration of a portion of IGES Directory */
static struct dirpart *curp;
struct dirpart *iges_get_curp (void)
return curp;
}
-/* Declaration d'un parametre IGES (Psect) */
+/* Declaration of an IGES parameter (Psect) */
static struct oneparam {
struct oneparam *next;
int typarg;
} *firstpage = NULL;
#define Maxpar 20000
-static struct parpage { /* une page de parametres ; cf AddParam */
+static struct parpage { /* a page of parameters; see AddParam */
struct parpage* next;
int used;
struct oneparam params[Maxpar+1];
static struct dirpage *curpage;
-/* ROUTINES UTILITAIRES de traitement des textes (char*) */
+/* UTILITY ROUTINES for text processing (char*) */
-/* Gestion du texte courant : c'est un texte alloue dynamiquement
- iges_newchar en alloue un (jete le precedent alloue si pas lu)
- rec_gettext lit le texte en cours, qui ne sera pas desalloue ensuite
- rec_settext en force un autre en jetant le precedent (idem rec_newtext)
- tandis que rec_newtext alloue un texte, sans lien avec le courant
+/* Current text management: it's a dynamically allocated text
+ iges_newchar allocates one (discards the previous allocated if not read)
+ rec_gettext reads the current text, which will not be deallocated afterwards
+ rec_settext forces another by discarding the previous (same as rec_newtext)
+ while rec_newtext allocates a text, without link to the current one
*/
#define Maxcar 10000
static struct carpage {
- struct carpage* next; /* chainage des pages de caracteres */
- int used; /* place deja prise */
- char cars[Maxcar+1]; /* page de caracteres */
+ struct carpage* next; /* chaining of character pages */
+ int used; /* space already taken */
+ char cars[Maxcar+1]; /* character page */
} *onecarpage;
- static char* restext = NULL ; /* texte courant (allocation dynamique) */
-/* static int resalloc = 0 ; */ /* alloue (memoire a liberer) ou non */
+ static char* restext = NULL ; /* current text (dynamic allocation) */
+/* static int resalloc = 0 ; */ /* allocated (memory to free) or not */
-/* Utilitaire : Reservation de caracteres
- Remplace suite de mini-malloc par gestion de page */
+/* Utility: Character reservation
+ Replaces series of mini-malloc with page management */
static char* iges_newchar (int lentext)
{
}
-/* FICHIER IGES Proprement Dit */
+/* IGES FILE Properly Speaking */
-/* Initialisation de l'enregistrement d'un fichier */
+/* Initialization of file recording */
void iges_initfile()
{
onecarpage = (struct carpage*) malloc ( sizeof(struct carpage) );
header = (struct parlist*) malloc ( sizeof(struct parlist) );
header->first = header->last = NULL; header->nbparam = 0;
- curlist = starts; /* On commence a enregistrer la start section */
+ curlist = starts; /* We start recording the start section */
nbparts = nbparams = 0;
firstpage = (struct dirpage*) malloc ( sizeof(struct dirpage) );
firstpage->next = NULL; firstpage->used = 0;
curpage = firstpage;
}
-/* Passage au Header (Global Section), lecture comme ecriture */
+/* Switch to Header (Global Section), reading as writing */
void iges_setglobal()
{ if (curlist == header) return; curlist = header; curparam = curlist->first; }
-/* Definition et Selection d'un nouveau dirpart */
+/* Definition and Selection of a new dirpart */
void iges_newpart(int numsec)
{
}
-/* Selection du dirpart dnum, correspond a numsec en Psect */
+/* Selection of dirpart dnum, corresponds to numsec in Psect */
void iges_curpart (int dnum)
{
}
curpage = curpage->next;
}
- curp = NULL; /* pas trouve */
+ curp = NULL; /* not found */
}
-/* Definition d'un nouveau parametre */
-/* (manque la gestion d'un Hollerith sur plusieurs lignes) */
+/* Definition of a new parameter */
+/* (missing management of Hollerith over multiple lines) */
-/* longval : longueur de parval, incluant le zero final */
+/* longval: length of parval, including the final zero */
void iges_newparam (int typarg, int longval, char *parval)
{
char *newval;
int i;
- if (curlist == NULL) return; /* non defini : abandon */
+ if (curlist == NULL) return; /* not defined: abort */
newval = iges_newchar(longval);
for (i = 0; i < longval; i++) newval[i] = parval[i];
nbparams ++;
}
-/* Complement du parametre courant (cf Hollerith sur +ieurs lignes) */
+/* Complement of current parameter (see Hollerith over multiple lines) */
void iges_addparam (int longval, char* parval)
{
char *newval, *oldval;
}
-/* Relecture : Initialiation */
-/* entites relues par suite de lirpart + {lirparam}
- lirparam initiaux : pour relire le demarrage (start section) */
+/* Re-reading: Initialization */
+/* entities re-read following lirpart + {lirparam}
+ initial lirparam: to re-read the startup (start section) */
void iges_stats (int* nbpart, int* nbparam)
{
curpage = firstpage; curnumpart = 0;
*nbparam = nbparams;
}
-/* Lecture d'une part : retour = n0 section, 0 si fin */
-/* \par tabval tableau recepteur des entiers (reserver 17 valeurs) */
-/* \par res1 res2 nom num char : transmis a part */
+/* Reading a part: return = section n0, 0 if end */
+/* \par tabval integer receiver array (reserve 17 values) */
+/* \par res1 res2 nom num char: transmitted to part */
int iges_lirpart (int* *tabval, char* *res1, char* *res2, char* *nom, char* *num, int *nbparam)
{
if (curpage == NULL) return 0;
curlist = &(curp->list);
*nbparam = curlist->nbparam;
curparam = curlist->first;
- *tabval = &(curp->typ); /* adresse de curp = adresse du tableau */
+ *tabval = &(curp->typ); /* address of curp = address of array */
*res1 = curp->res1; *res2 = curp->res2;
*nom = curp->nom; *num = curp->num;
return curp->numpart;
}
-/* Passage au suivant (une fois lus les parametres) */
+/* Move to next (once parameters are read) */
void iges_nextpart()
{
curnumpart ++;
- if (curnumpart >= curpage->used) { /* attention, adressage de 0 a used-1 */
+ if (curnumpart >= curpage->used) { /* caution, addressing from 0 to used-1 */
curpage = curpage->next;
curnumpart = 0;
}
}
-/* Lecture parametre + passage au suivant */
-int iges_lirparam (int *typarg, char* *parval) /* renvoie 0 si fin de liste, 1 sinon */
+/* Read parameter + move to next */
+int iges_lirparam (int *typarg, char* *parval) /* returns 0 if end of list, 1 otherwise */
{
if (curparam == NULL) return 0;
*typarg = curparam->typarg;
return 1;
}
-/* Fin pour ce fichier : liberer la place */
-/* mode = 0 : tout; 1 : parametres; 2 : caracteres */
+/* End for this file: free the space */
+/* mode = 0: all; 1: parameters; 2: characters */
void iges_finfile (int mode)
{
struct dirpage* oldpage;
if (IsFromParabola())
{
- Rmin = Rmax = -1.; // rayons : yena pas
+ Rmin = Rmax = -1.; // radii : there are none
if ((Abs(a) <= eps) && (Abs(b) <= eps))
{
Xcen = (f * c - e * e) / c / d / 2.;
else
{
- // -> Conique a centre, cas general
- // On utilise les Determinants des matrices :
+ // -> Centered conic, general case
+ // We use the matrix Determinants :
// | a b d |
- // gdet (3x3) = | b c e | et pdet (2X2) = | a b |
- // | d e f | | b c |
+ // gdet (3x3) = | b c e | and pdet (2X2) = | a b |
+ // | d e f | | b c |
Standard_Real gdet = a * c * f + 2 * b * d * e - c * d * d - a * e * e - b * b * f;
Standard_Real pdet = a * c - b * b;
void IGESGeom_CopiousData::SetClosedPath2D()
{
- InitTypeAndForm(106, 63); // et verifier DataType !
+ InitTypeAndForm(106, 63); // and verify DataType !
}
Standard_Boolean IGESGeom_CopiousData::IsPointSet() const
// Message_Msg Msg109("XSTEP_109");
//========================================
- Standard_Real eps = 1.E-04; // Tolerance des tests ??
+ Standard_Real eps = 1.E-04; // Test tolerance ??
// Standard_Real norm = ent->Normal().SquareModulus();
// modified by rln 17/12/97 check of flag PROP2 according to IGES Standard
st = PR.ReadReal(PR.Current(), "Starting Value For V Direction", aVmin);
st = PR.ReadReal(PR.Current(), "Ending Value For U Direction", aVmax);
*/
- // PROTECTION contre ANSYS 5.3 qui ecrit 3 flottants en plus ...
+ // PROTECTION against ANSYS 5.3 which writes 3 additional floats ...
Standard_Integer icur = PR.CurrentNumber(), imax = PR.NbParams();
Standard_Real bid;
Standard_Integer pbfin = 0;
if (ent->BoundaryType() != 0)
return res; // OK
- // Reste Boundary Type : s ilya des ParameterCurves, il doit valoir 1
- // On reconstruit donc la Boundary a l identique, mais avec BoundaryType = 1
+ // Remaining Boundary Type : if there are ParameterCurves, it must be valued 1
+ // We therefore reconstruct the Boundary identically, but with BoundaryType = 1
- // si type = 0, annuller tous les ParameterCurves
- // -> On reconstruit, avec ParameterCurves Nulles
- // En plus, les ParameterCurves doivent avoir leur UseFlag a 5
+ // if type = 0, nullify all ParameterCurves
+ // -> We reconstruct, with Null ParameterCurves
+ // In addition, the ParameterCurves must have their UseFlag at 5
Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) cv2d =
new IGESBasic_HArray1OfHArray1OfIGESEntity(1, nb);
ach->SendFail(Msg123);
}
- // il faudrait aussi tester que, pour BoundaryType = 1, la Surface est bien
- // Parametrique ... (au moins un cas ne passe pas : c est Plane 108)
+ // we should also test that, for BoundaryType = 1, the Surface is indeed
+ // Parametric ... (at least one case fails : it is Plane 108)
if (ent->BoundaryType() == 1)
{
if (ent->Surface()->TypeNumber() == 108)
Handle(Interface_Check)& /*ach*/) const
{
/*
- //Standard_Real eps = 1.E-04; // Tolerance des tests ?? //szv#4:S4163:12Mar99 not needed
+ //Standard_Real eps = 1.E-04; // Test tolerance ?? //szv#4:S4163:12Mar99 not needed
Standard_Real Rad1 = Sqrt(Square(ent->StartPoint().X() - ent->Center().X()) +
Square(ent->StartPoint().Y() - ent->Center().Y()));
// Standard_Integer pref = ent->PreferenceMode();
// if (pref < 0 || pref > 3)
// ach.SendFail("Incorrect value for the Preference Mode");
- // tolerance a la norme
+ // tolerance to the standard
// if (pref == 1 && ent->CurveUV().IsNull())
// ach.AddWarning("Preference Mode asks UV and Curve UV not defined");
// if (pref == 2 && ent->Curve3D().IsNull())
Handle(IGESData_IGESEntity) func = ent->Function();
if (func.IsNull())
return Standard_False;
- // OffsetType != 3 : reconstruire avec Offset Function Nulle
+ // OffsetType != 3 : reconstruct with Null Offset Function
func.Nullify();
ent->Init(ent->BaseCurve(),
ent->OffsetType(),
}
} // szv#4:S4163:12Mar99 `st=` not needed
// st = PR.ReadEntity(IR, PR.Current(), "Bounding Curve", aCurve,Standard_True);
- // en principe exige si FormNumber != 0 ... cf OwnCheck (Load accepte)
+ // in principle required if FormNumber != 0 ... see OwnCheck (Load accepts)
if (PR.IsParamDefined(PR.CurrentNumber()))
{
ach->SendFail(Msg137);
}
// These messages are transferred in the translation procedure
- // if ( (A*A + B*B + C*C) < eps) // pas nul !
+ // if ( (A*A + B*B + C*C) < eps) // not null !
// ach.SendFail("Incorrect Coefficients for the Plane");
if (!ent->HasBoundingCurve())
return;
- // Symbol : verifie si Size defini > 0 (sinon, n a pas de signification)
+ // Symbol : check if Size defined > 0 (otherwise, has no meaning)
/* Standard_Real ec = 0.;
if (ent->SymbolSize() > 0.) ec = A*ent->SymbolAttach().X() + B*ent->SymbolAttach().Y() +
C * ent->SymbolAttach().Z() - D;
}
else
{
- // Si fin manquante ... On refait temp !
- // Les valeurs n ont pas ete lues ... il faut d abord les relire !
+ // If end missing ... We redo temp !
+ // The values were not read ... we must first re-read them !
Temp = new TColStd_HArray1OfReal(1, 16);
Temp->Init(0.);
for (k = 1; k <= 16; k++)
}
// These messages are transferred in the translation procedure
/*
- if (form > 1) return; // ce qui suit : matrice orthogonale
+ if (form > 1) return; // what follows : orthogonal matrix
if (form == 0 && ent->Value().IsNegative())
ach.AddFail("For Form 0, Determinant is not Positive");
else if (form == 1 && !ent->Value().IsNegative())
IW.Send(Red);
IW.Send(Green);
IW.Send(Blue);
- // ATTENTION place a reserver (Null) silya des pointeurs additionnels
+ // WARNING place to reserve (Null) if there are additional pointers
if (ent->HasColorName())
IW.Send(ent->ColorName());
else
}
break;
case 3:
- break; // nom libre
+ break; // free name
case 4:
if (strcmp(unm, "FT") == 0)
{
}
break;
default:
- break; // on ne peut rien faire ... ?
+ break; // we can't do anything ... ?
}
res |= (!name.IsNull());
break;
case 3:
unok = Standard_True;
- break; // nom libre
+ break; // free name
case 4:
unok = !strcmp(unm, "FT");
break;
if (igesent.IsNull() || model.IsNull())
return 0;
- // Plane : de View ? de SingleParent ? sinon cf TrimmedSurface & cie
+ // Plane : from View? from SingleParent? otherwise see TrimmedSurface & co
return 0;
}
switch (number)
{
- case 5: // **** ListViews (sans tri complementaire)
+ case 5: // **** ListViews (without additional sorting)
case 6: // **** ListDrawings
case 7: { // **** ListS(ingle)Views
Standard_Integer listmode = 0;
argc = -1;
if (argc < 2)
{
- std::cout << "Ajouter un argument pour avoir :\n"
- << " l : liste resumee"
- << " c : liste complete par item (mais pas pour remaining)\n"
- << " r : idem + liste complete remaining\n"
- << " sur tout le modele. Ajouter nom selection pour lister sur une partie"
- << std::endl;
+ std::cout << "Add an argument to have :\n"
+ << " l : summary list"
+ << " c : complete list per item (but not for remaining)\n"
+ << " r : same + complete remaining list\n"
+ << " on entire model. Add selection name to list on a part" << std::endl;
return (argc >= 0 ? IFSelect_RetError : IFSelect_RetVoid);
}
if (arg1[0] == 'l')
else if (arg1[0] == 'c')
{
listmode = 1;
- std::cout << "Liste complete par item (pas pour Remaining)" << std::endl;
+ std::cout << "Complete list per item (not for Remaining)" << std::endl;
}
else if (arg1[0] == 'r')
{
listmode = 2;
- std::cout << "Liste complete par item et pour Remaining" << std::endl;
+ std::cout << "Complete list per item and for Remaining" << std::endl;
}
else
{
case 10: { // **** IGESType (form Type/Form)
if (argc < 2)
{
- std::cout << "Donner le n0 de type desire, + en option la forme\n"
- << " Si pas de forme, prend toutes les formes du type demande" << std::endl;
+ std::cout << "Give the desired type number, + optionally the form\n"
+ << " If no form, takes all forms of the requested type" << std::endl;
return IFSelect_RetError;
}
char signature[20];
case 12: { // **** IGES Name
if (argc < 2)
{
- std::cout << "Donner un Nom de TextParam pour IGESName" << std::endl;
+ std::cout << "Give a TextParam Name for IGESName" << std::endl;
return IFSelect_RetError;
}
Handle(IGESSelect_SelectName) sel = new IGESSelect_SelectName;
case 14: { // **** IGES LevelNumber
if (argc < 2)
{
- std::cout << "Donner nom IntParam pour Level" << std::endl;
+ std::cout << "Give IntParam name for Level" << std::endl;
return IFSelect_RetError;
}
DeclareAndCast(IFSelect_IntParam, lev, WS->NamedItem(arg1));
if (lev.IsNull())
{
- std::cout << arg1 << " : pas un IntParam (pour Level)" << std::endl;
+ std::cout << arg1 << " : not an IntParam (for Level)" << std::endl;
return IFSelect_RetError;
}
Handle(IGESSelect_SelectLevelNumber) sel = new IGESSelect_SelectLevelNumber;
prem = '?';
else if (argc == 5)
{
- std::cout << "floatformat tout court donne les formes admises" << std::endl;
+ std::cout << "floatformat alone gives the accepted forms" << std::endl;
return IFSelect_RetError;
}
else
digits = atoi(arg1);
else
{
- std::cout << "floatformat digits, digits=nb de chiffres signifiants, ou\n"
+ std::cout << "floatformat digits, digits=nb of significant digits, or\n"
<< "floatformat NZ %mainformat [%rangeformat [Rmin Rmax]]\n"
- << " NZ : N ou n pour Non-zero-suppress, Z ou z pour zero-suppress\n"
- << " %mainformat : format principal type printf, ex,: %E\n"
- << " + optionnel : format secondaire (flottants autour de 1.) :\n"
- << " %rangeformat Rmin Rmax : format type printf entre Rmin et Rmax\n"
- << " %rangeformat tout seul : format type printf entre 0.1 et 1000.\n"
+ << " NZ : N or n for Non-zero-suppress, Z or z for zero-suppress\n"
+ << " %mainformat : main format printf type, ex,: %E\n"
+ << " + optional : secondary format (floats around 1.) :\n"
+ << " %rangeformat Rmin Rmax : printf type format between Rmin and Rmax\n"
+ << " %rangeformat alone : printf type format between 0.1 and 1000.\n"
<< std::flush;
return (prem == '?' ? IFSelect_RetVoid : IFSelect_RetError);
}
case 41: { // **** SetGlobalParameter
if (argc < 3)
{
- std::cout << "Donner entier=n0 param a changer + nom TextParam pour la valeur" << std::endl;
+ std::cout << "Give integer=n0 param to change + TextParam name for the value" << std::endl;
return IFSelect_RetError;
}
Standard_Integer numpar = atoi(arg1);
case 60: { // **** Spline To BSpline
if (argc < 2)
{
- std::cout << "Pour SplineToBSpline, donner mode :\n"
- << " n pour normal, t pour tryC2" << std::endl;
+ std::cout << "For SplineToBSpline, give mode :\n"
+ << " n for normal, t for tryC2" << std::endl;
return IFSelect_RetError;
}
Standard_Boolean tryC2;
switch (number)
{
case 5:
- return "Liste Vues (tous types). Nom selection sinon tout modele";
+ return "List Views (all types). Selection name otherwise entire model";
case 6:
- return "Liste Drawings. Nom selection sinon tout modele";
+ return "List Drawings. Selection name otherwise entire model";
case 7:
- return "Liste Vues SIMPLES. Nom selection sinon tout modele";
+ return "List SIMPLE Views. Selection name otherwise entire model";
case 10:
return "type:integer [form:integer] : cree Select IGESType";
case 21:
return "cree Select From Drawing";
case 22:
- return "cree Select From Single View";
+ return "create Select From Single View";
case 23:
- return "cree Select Drawing From, drawing(s) pour une liste d entites";
+ return "create Select Drawing From, drawing(s) for an entity list";
case 24:
- return "cree Select View From, views pour une liste d entites";
+ return "create Select View From, views for an entity list";
case 31:
- return "cree Dispatch Per Drawing";
+ return "create Dispatch Per Drawing";
case 32:
- return "cree Dispatch Per SingleView";
+ return "create Dispatch Per SingleView";
case 40:
- return "options... : cree FloatFormat ... floatformat tout court->help";
+ return "options... : create FloatFormat ... floatformat alone->help";
case 41:
- return "numpar:integer value:TextParam : cree Set Global Param";
+ return "numpar:integer value:TextParam : create Set Global Param";
case 42:
return "cree Set Version -> 5.1";
case 43:
const Handle(IGESData_IGESModel)& target,
Interface_CopyTool& TC) const
{
- // On reconstruit les groupes qui peuvent l etre
- // Pour chaque groupe de l original, on regarde les composants transferes
- // (evt filtres par <ctx>)
- // Ensuite, silyena plus d une, on refait un nouveau groupe
+ // We rebuild the groups that can be
+ // For each group of the original, we look at the transferred components
+ // (possibly filtered by <ctx>)
+ // Then, if there are more than one, we create a new group
DeclareAndCast(IGESData_IGESModel, original, ctx.OriginalModel());
Standard_Integer nbo = original->NbEntities();
- // Entites a prendre en compte pour la reconstruction
+ // Entities to consider for reconstruction
// NB : Les groupes deja transferes ne sont bien sur pas reconstruits !
TColStd_Array1OfInteger pris(0, nbo);
pris.Init(0);
const Interface_Graph& /*G*/,
Interface_EntityIterator& explored) const
{
- DeclareAndCast(IGESBasic_Group, gr, ent); // Group les regroupe tous
+ DeclareAndCast(IGESBasic_Group, gr, ent); // Group groups them all
if (gr.IsNull())
return Standard_True;
explored.AddItem(subf->BaseEntity());
}
- // Si c est pas tout ca, c est un objet de base et on le prend tel quel
+ // If it's not all that, it's a base object and we take it as is
return Standard_True;
}
return Standard_False;
}
}
- return exact; // un brin de reflexion pour arriver
+ return exact; // a bit of reflection to arrive
}
if (themap.FindIndex(igesent))
return Standard_False;
themap.Add(igesent);
- // Recuperation de la vue (attention au cas du Drawing)
+ // View recovery (watch out for Drawing case)
Handle(IGESData_IGESEntity) view;
if (igesent->TypeNumber() == PourDrawing)
view = igesent; // DRAWING
void IGESSelect_ViewSorter::SortSingleViews(const Standard_Boolean alsoframes)
{
- // Du tas initial, on ecarte : les vues nulles, et selon alsoframe les drawings
- // Vues nulles : cf theremain (remain initial reconduit)
+ // From the initial pile, we exclude : null views, and according to alsoframe the drawings
+ // Null views : see theremain (initial remain carried forward)
- // Remarque : le filtre IsSingle a ete applique par Add
+ // Note : the IsSingle filter has been applied by Add
thefinals.Clear();
Standard_Integer nb = theinditem.Length();
// Standard_Integer numit = 0; //szv#4:S4163:12Mar99 not needed
return;
}
- // On attaque le dump : d abord cas de l Erreur
+ // We start the dump : first the Error case
if (iserr)
{
S << " ERRONEOUS, Content, Type cdl : ";
if (!theIsoparametricFlags->Value(EdgeIndex).IsNull())
return (theIsoparametricFlags->Value(EdgeIndex)->Value(CurveIndex) != 0);
else
- return Standard_False; // faut bien dire qq chose
+ return Standard_False; // must say something
}
Handle(IGESData_IGESEntity) IGESSolid_Loop::ParametricCurve(const Standard_Integer EdgeIndex,
const Standard_Integer CurveIndex) const
{
- Handle(IGESData_IGESEntity) acurve; // par defaut sera nulle
+ Handle(IGESData_IGESEntity) acurve; // by default will be null
if (!theCurves->Value(EdgeIndex).IsNull())
acurve = theCurves->Value(EdgeIndex)->Value(CurveIndex);
return acurve;
IW.Send(ent->Radius());
IW.Send(ent->SemiAngle());
if (ent->IsParametrised())
- IW.Send(ent->ReferenceDir()); // cf FormNumber
+ IW.Send(ent->ReferenceDir()); // see FormNumber
}
void IGESSolid_ToolConicalSurface::OwnShared(const Handle(IGESSolid_ConicalSurface)& ent,
void IGESSolid_TopoBuilder::EndEdge()
{
- // transformer thecuruv,theiso en array et le mettre dans theeuv
+ // transform thecuruv,theiso to array and put it in theeuv
Handle(IGESData_HArray1OfIGESEntity) curuv;
Handle(TColStd_HArray1OfInteger) iso;
if (!thecuruv->IsEmpty())
return Standard_True;
// S4181 pdn 15.04.99 removing to basic surface
// if (start->IsKind(STANDARD_TYPE(IGESSolid_PlaneSurface))) return Standard_True;
- // SingleParent, cas particulier (Face Trouee : ne contient que des PLANE)
+ // SingleParent, special case (Perforated Face: contains only PLANEs)
if (start->IsKind(STANDARD_TYPE(IGESBasic_SingleParent)))
{
DeclareAndCast(IGESBasic_SingleParent, sp, start);
Standard_Real first, last;
Handle(Geom_Curve) Crv = BRep_Tool::Curve(edge, loc, first, last);
Handle(Geom_Curve) newC3d;
- // dams le cas d`une conique, il faut reverser
- // sens de parcours IGES inverse sens de parcours CASCADE.
+ // in the case of a conic, it is necessary to reverse
+ // IGES direction of travel inverse to CASCADE direction of travel.
if (Crv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
{
DeclareAndCast(Geom_TrimmedCurve, acurve, Crv);
// clang-format on
B.Range(E, first, last);
}
- // modif mjm du 13/10/97 : Reverse de l`edge ?
+ // modification mjm of 13/10/97 : Reverse the edge?
else
{
E.Reverse();
if (!orientation)
curve3d->Reverse();
- // traitement des courbes 2d.
+ // processing of 2d curves.
// -------------------------
Handle(IGESData_HArray1OfIGESEntity) Curves2d;
|| surf->IsKind(STANDARD_TYPE(IGESGeom_TrimmedSurface))
|| surf->IsKind(STANDARD_TYPE(IGESBasic_SingleParent)))
{
- Message_Msg Msg196("XSTEP_196"); //"pas de surface de base pour creer la face"
+ Message_Msg Msg196("XSTEP_196"); //"no base surface to create the face"
SendWarning(start, Msg196);
- // AddWarning(start, "pas de surface de base pour creer la face");
+ // AddWarning(start, "no base surface to create the face");
TopoDS_Shape Sh;
SetShapeResult(start, Sh);
}
else
{
- // si la surface IGES est une surface de revolution , il faudra
- // inverser les courbes 2d (u,v) pour etre en accord avec le parametrage
+ // if the IGES surface is a surface of revolution, it will be necessary
+ // to invert the 2d curves (u,v) to be in agreement with the parametrization
// BRep.
gp_Trsf2d trans;
Standard_Real uFact;
SendWarning(st, msg1160);
}
else if (t1 > t2)
- res = new Geom_TrimmedCurve(res, t2, t1); // inversion des parametres.
+ res = new Geom_TrimmedCurve(res, t2, t1); // parameter inversion.
else
res = new Geom_TrimmedCurve(res, t1, t2);
}
SendWarning(st, msg1160);
}
else if (t1 > t2)
- res = new Geom2d_TrimmedCurve(res, t2, t1); // inversion des parametres.
+ res = new Geom2d_TrimmedCurve(res, t2, t1); // parameter inversion.
else
res = new Geom2d_TrimmedCurve(res, t1, t2);
return res;
SendWarning(st, msg1160);
}
else if (t1 > t2)
- res = new Geom2d_TrimmedCurve(res, t2, t1); // inversion des parametres.
+ res = new Geom2d_TrimmedCurve(res, t2, t1); // parameter inversion.
else
res = new Geom2d_TrimmedCurve(res, t1, t2);
}
SumOfMult += aMult;
}
- // Mise a jour du tableau des poles lors de la correction de la multiplicite
+ // Update of the poles array during multiplicity correction
TColgp_Array1OfPnt Poles(1, newNbPoles);
TColStd_SequenceOfInteger PoleInd;
SendWarning(start, msg1220);
// Rational curve is polynomial
}
- // Mise a jour du tableau des Weight lors de la correction de la multiplicite
+ // Update of the Weight array during multiplicity correction
if (newNbPoles < NbPoles)
{
Standard_Integer indj = 1;
res = BSplineC;
- // cas ou la Bspline est trimmee.
+ // case where the Bspline is trimmed.
if (IsTrimmed)
{
Handle(Geom2d_TrimmedCurve) TC = new Geom2d_TrimmedCurve(BSplineC, Deb, Fin, Standard_True);
Pe = start->EndPoint();
}
- // modif du 15/10/97 : test moins severe
- // beaucoup de points confondus a GetEpsGeom()*GetUnitFactor()
+ // modification of 15/10/97: less severe test
+ // many points confused at GetEpsGeom()*GetUnitFactor()
if (!Ps.IsEqual(Pe, Precision::Confusion()))
{ //: l3 abv 11 Jan 99: GetEpsGeom()*GetUnitFactor()/10.)) {
gp_Lin line(Ps, gp_Dir(gp_Vec(Ps, Pe)));
// Sum of multiplicities following V is not equal to the sum : Count of poles + Degree V + 1
}
- // Mise a jour du tableau des poles
+ // Update of the poles array
TColgp_Array2OfPnt Poles(1, newNbPolesU, 1, newNbPolesV);
TColStd_SequenceOfInteger PoleUInd;
TColStd_SequenceOfInteger PoleVInd;
msg1220.Arg(surface);
SendWarning(start, msg1220);
}
- // Mise a jour du tableau des Weight lors de la correction de la multiplicite
+ // Update of the Weight array during multiplicity correction
TColStd_Array2OfReal Weight(1, newNbPolesU, 1, newNbPolesV);
UIndex = Weight.LowerRow();
VIndex = Weight.LowerCol();
return myshape;
}
- // si la courbe est une BSpline de degre 1, et si l`utilisateur
- // le souhaite, on approxime
+ // if the curve is a BSpline of degree 1, and if the user
+ // wishes it, we approximate
TheCurves.Clear();
if ((C->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) && GetModeApprox())
{
// 15.03.2011 emv for OCC22294 end
// debug mjm du 26/07/96 en attendant developpement meilleur
- // sur traitement des Wire et non des Edge dans les programmes appelant
+ // on Wire processing and not Edge in calling programs
if (sewd->NbEdges() != 1)
{
// B.UpdateVertex (V2, epsgeom);
// debug mjm du 26/07/96 en attendant developpement meilleur
- // sur traitement des Wire et non des Edge dans les programmes appelant
+ // on Wire processing and not Edge in calling programs
if (sewd->NbEdges() != 1)
{
if (IsFullAngle)
deltaAngle = 2. * M_PI; // ** CKY 18-SEP-1996
// il faudra translater les courbes 2d de startAngle pour
- // etre en phase IGES et BRep
+ // be in phase IGES and BRep
startLoc.SetRotation(revolAxis, startAngle);
generatrix.Move(startLoc);
gp_Pln pln;
gp_Trsf trsf;
res = TransferPlaneParts(st, pln, trsf, Standard_True);
- // res contient (en principe ...) une Face avec eventuellement un Wire
- // il reste a la mettre en position
+ // res contains (in principle ...) a Face with possibly a Wire
+ // it remains to position it
if (trsf.Form() != gp_Identity)
{
TopLoc_Location loc(trsf);
return res;
}
res = TransferPlaneParts(p0, pln, trsf, Standard_True);
- // res demarre avec la face et son contour externe
+ // res starts with the face and its external contour
Standard_Integer nb = st->NbChildren();
for (Standard_Integer i = 1; i <= nb; i++)
{