Got rid of -Wreorder warning (wrong fields' initialization order); some warnings -Wdangling-else are also fixed
selector->Init();
if ( selector->More() )
{
- if ( HasOpenedContext() )
+ if ( HasOpenedContext() )
+ {
if ( !myFilters->IsOk( selector->OnePicked() ) )
- return AIS_SOD_AllBad;
+ return AIS_SOD_AllBad;
else
if ( !myLocalContexts( myCurLocalIndex )->Filter()->IsOk( selector->OnePicked() ) )
return AIS_SOD_AllBad;
-
+ }
// Does nothing if previously detected object is equal to the current one
if ( selector->OnePicked()->Selectable() == myLastPicked )
const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
for(i = 1; i <= myMapOfOwner.Extent(); i++){
const Handle(SelectMgr_EntityOwner)& anOwner = myMapOfOwner(i) ;
- if(!anOwner.IsNull())
+ if(!anOwner.IsNull()) {
if(anOwner->Selectable() != aSelectable)
ownersToKeep.Add(anOwner);
else
Unhilight(anOwner, aViewer->ActiveView());
}
}
+ }
}
myMapOfOwner.Clear();
myMapOfOwner.Assign(ownersToKeep);
if ( S->myResultMap.IsBound( anObject ) ){
AIS_NListTransient::Iterator aListIter = S->myResultMap.Find( anObject );
//skt-----------------------------------------------------------------
- if( S->myIterator == aListIter )
- if( S->myIterator.More() )
- S->myIterator.Next();
- else
- S->myIterator = AIS_NListTransient::Iterator();
+ if( S->myIterator == aListIter ) {
+ if( S->myIterator.More() )
+ S->myIterator.Next();
+ else
+ S->myIterator = AIS_NListTransient::Iterator();
+ }
//--------------------------------------------------------------------
#ifdef BUC60953
// In the mode of advanced mesh selection only one owner is created
}
-Adaptor3d_TopolTool::Adaptor3d_TopolTool () : nbRestr(0),idRestr(0),myNbSamplesU(-1)
+Adaptor3d_TopolTool::Adaptor3d_TopolTool () : nbRestr(0),myNbSamplesU(-1),idRestr(0)
{
}
myXPos( 0 ),
myYPos( 0 ),
myWidth( 0.2 ),
-myHeight( 1 ),
myTitle( "" ),
-myInterval( 10 ),
+myHeight( 1 ),
myFormat( "%.4g" ),
+myInterval( 10 ),
myAtBorder( Standard_True ),
-myReversed( Standard_False ),
myColorType( Aspect_TOCSD_AUTO ),
+myReversed( Standard_False ),
myLabelType( Aspect_TOCSD_AUTO ),
myLabelPos( Aspect_TOCSP_RIGHT ),
myTitlePos( Aspect_TOCSP_CENTER ),
myMapShapeIndex(100, myAllocator),
myPaveBlocksPool(myAllocator),
myFaceInfoPool(myAllocator),
- myShapesSD(100, myAllocator),
myMapPBCB(100, myAllocator),
+ myShapesSD(100, myAllocator),
myInterfTB(100, myAllocator),
myInterfVV(myAllocator),
myInterfVE(myAllocator),
myMapShapeIndex(100, myAllocator),
myPaveBlocksPool(myAllocator),
myFaceInfoPool(myAllocator),
- myShapesSD(100, myAllocator),
myMapPBCB(100, myAllocator),
+ myShapesSD(100, myAllocator),
myInterfTB(100, myAllocator),
myInterfVV(myAllocator),
myInterfVE(myAllocator),
};
//
protected:
- Standard_Boolean myRegular;
Handle(NCollection_BaseAllocator) myAllocator;
+ Standard_Boolean myRegular;
BOPCol_ListOfShape myShapes;
BOPCol_ListOfShape myLoops;
};
const TopoDS_Shape &S2 = Map2(j);
BRepExtrema_DistanceSS dist(S1,S2,box1,box2,myDistRef,myEps);
- if (dist.IsDone())
+ if (dist.IsDone()) {
if(dist.DistValue() < (myDistRef-myEps))
{
mySolutionsShape1.Clear();
if (myDistRef > dist.DistValue())
myDistRef=dist.DistValue();
}
+ }
}
}
}
//=======================================================================
BRepFill_PipeShell::BRepFill_PipeShell(const TopoDS_Wire& Spine)
: mySpine(Spine),
- myTrihedron(GeomFill_IsCorrectedFrenet),
- myTransition(BRepFill_Modified),
+ myTrihedron(GeomFill_IsCorrectedFrenet),
myForceApproxC1(Standard_False),
- myStatus(GeomFill_PipeOk)
+ myTransition(BRepFill_Modified),
+ myStatus(GeomFill_PipeOk)
{
myLocation.Nullify();
mySection.Nullify();
}
}
- if (ipath == 1)
- if (uclose && (isec == NbLaw)) {
- Vertex(isec+1, 1) = Vertex(1, 1);
- }
- else if (Vertex(isec+1, 1).IsNull()) {
- if (constSection)
- myLoc->PerformVertex(IPath-1,
- TopoDS::Vertex(SecVertex(isec+1)),
- TabErr(isec,1)+VError(isec+1),
- TopoDS::Vertex(Vertex(isec+1, 1)) );
- else
- myLoc->PerformVertex(IPath-1,
- mySec->Vertex(isec+1,Vi(1)),
- TabErr(isec,1) +
- mySec->VertexTol(isec,Vi(1)),
- TopoDS::Vertex(Vertex(isec+1, 1)) );
- if (MergeVertex(Vertex(isec,1), Vertex(isec+1,1))) {
- VEdge(isec, 1) = NullEdge(Vertex(isec, 1));
- }
- }
+ if (ipath == 1) {
+ if (uclose && (isec == NbLaw)) {
+ Vertex(isec+1, 1) = Vertex(1, 1);
+ }
+ else if (Vertex(isec+1, 1).IsNull()) {
+ if (constSection)
+ myLoc->PerformVertex(IPath-1,
+ TopoDS::Vertex(SecVertex(isec+1)),
+ TabErr(isec,1)+VError(isec+1),
+ TopoDS::Vertex(Vertex(isec+1, 1)) );
+ else
+ myLoc->PerformVertex(IPath-1,
+ mySec->Vertex(isec+1,Vi(1)),
+ TabErr(isec,1) +
+ mySec->VertexTol(isec,Vi(1)),
+ TopoDS::Vertex(Vertex(isec+1, 1)) );
+ if (MergeVertex(Vertex(isec,1), Vertex(isec+1,1))) {
+ VEdge(isec, 1) = NullEdge(Vertex(isec, 1));
+ }
+ }
+ }
if (uclose && (isec == NbLaw)) {
Vertex(isec+1, ipath+1) = Vertex(1, ipath+1);
private:
Standard_Integer myEdge1;
- Standard_Boolean myOrientation1;
Standard_Integer myEdge2;
- Standard_Boolean myOrientation2;
Standard_Integer myEdge3;
+ Standard_Boolean myOrientation1;
+ Standard_Boolean myOrientation2;
Standard_Boolean myOrientation3;
BRepMesh_DegreeOfFreedom myMovability;
};
v = (Vsup - Vinf)*0.1;
if(S->IsUPeriodic()) {
Standard_Real uperiod = S->UPeriod();
- if(uperiod < (Usup+2*u-Uinf))
+ if(uperiod < (Usup+2*u-Uinf)) {
if(uperiod <= (Usup-Uinf))
u = 0;
else
u = (uperiod-(Usup-Uinf))*0.5;
+ }
}
if(S->IsVPeriodic()) {
Standard_Real vperiod = S->VPeriod();
- if(vperiod < (Vsup+2*v-Vinf))
+ if(vperiod < (Vsup+2*v-Vinf)) {
if(vperiod <= (Vsup-Vinf))
v = 0;
else
v = (vperiod-(Vsup-Vinf))*0.5;
+ }
}
GeomAdaptor_Surface GAS(S, Uinf-u,Usup+u,Vinf-v,Vsup+v);
Handle(GeomAdaptor_HSurface) GAHS = new GeomAdaptor_HSurface(GAS);
//=======================================================================
BinTools_ShapeSet::BinTools_ShapeSet(const Standard_Boolean isWithTriangles)
- :myWithTriangles(isWithTriangles), myFormatNb(3)
+ :myFormatNb(3), myWithTriangles(isWithTriangles)
{}
//=======================================================================
const Handle(Adaptor3d_HCurve)& C,
const Handle(Adaptor3d_HCurve)& CGuide,
const Handle(Law_Function)& L) :
- surf(S),curv(C),guide(CGuide),istangent(Standard_True),law(L),
+ surf(S),curv(C),guide(CGuide),law(L),istangent(Standard_True),
//prmc, dprmc, istangent, ray, choix, normtg,
maxang(RealFirst()),minang(RealLast()),mySShape(BlendFunc_Rational)
//myTConv
narc1 = Lin->StartPointOnFirst().NbPointOnRst();
narc2 = Lin->StartPointOnSecond().NbPointOnRst();
// modified by eap Fri Feb 8 11:43:48 2002 ___BEGIN___
- if(!debarc1)
+ if(!debarc1) {
if (narc1 == 0)
backwContinueFailed = Lin->StartPointOnFirst().ParameterOnGuide() > Target;
else {
// }
}
}
- if(!debarc2)
+ }
+ if(!debarc2) {
if (narc2 == 0)
backwContinueFailed = Lin->StartPointOnSecond().ParameterOnGuide() > Target;
else {
// }
}
}
+ }
if (backwContinueFailed) {
// if we leave backwContinueFailed as is, we will stop in this direction
// but we are to continue if there are no more faces on the side with arc
narc1 = Lin->EndPointOnFirst().NbPointOnRst();
narc2 = Lin->EndPointOnSecond().NbPointOnRst();
// modified by eap Fri Feb 8 11:44:57 2002 ___BEGIN___
- if(!finarc1)
+ if(!finarc1) {
if (narc1 == 0)
forwContinueFailed = Lin->EndPointOnFirst().ParameterOnGuide() < Target;
else {
// }
}
}
- if(!finarc2)
+ }
+ if(!finarc2) {
if (narc2 == 0)
forwContinueFailed = Lin->EndPointOnSecond().ParameterOnGuide() < Target;
else {
// }
}
}
+ }
if (forwContinueFailed) {
// if we leave forwContinueFailed as is, we will stop in this direction
// but we are to continue if there are no more faces on the side with arc
if (Affich > 1) {
cout << "Courbe : " << i << endl;
cout << " NbPnt, NbPtInter, NbPtG1G1 :" << NbPnt_i << ", "
- << NbPtInter << ", " << NbPtG1G1 << endl;
+ << NbPtInter << ", " << NbPtG1G1 << endl;
}
#endif
for (Standard_Integer j=1; j<=NbPnt_i; j++)
- { // repartition des points en cosinus selon l'ACR 2d
- // Afin d'eviter les points d'acumulation dans le 2d
- //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2);
- if (j==NbPnt_i)
- Inter=Ufinal;//pour parer au bug sur sun
- else if (ACR) {
- CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2;
- Inter = acrlaw->Value(CurLength);
- }
- else {
- Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2);
- }
- myParCont->ChangeValue(i).Append(Inter);// on ajoute le point
- if (NbPtInter!=0)
- { for(Standard_Integer l=1;l<=NbPtInter;l+=2)
- //on cherche si le point Inter est dans l'intervalle
- //PntInter[i] PntInter[i+1]
- //auquelle cas il ne faudrait pas le stocker (pb de doublons)
- { if ((Inter>PntInter->Value(i).Value(l))
- &&(Inter<PntInter->Value(i).Value(l+1)))
- { l=NbPtInter+2;
- // pour sortir de la boucle sans stocker le point
- }
- else
- { if (l+1>=NbPtInter)
- // on a parcouru tout le tableau : Le point
- // n'appartient pas a un interval point commun
- if (NbPtG1G1!=0)
- // est qu'il existe un intervalle incompatible
- for(Standard_Integer k=1;k<=NbPtG1G1;k+=2)
- { if ((Inter>PntG1G1->Value(i).Value(k))
- &&(Inter<PntG1G1->Value(i).Value(k+1)))
- { k=NbPtG1G1+2; // pour sortir de la boucle
- // Ajouter les points de contrainte G0
- gp_Pnt P3d,PP,Pdif;
- gp_Pnt2d P2d;
-
- AC2d.D0(Inter, P2d);
- LinCont->D0(Inter,P3d);
- mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP);
- Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1),
- -PP.Coord(2)+P3d.Coord(2),
- -PP.Coord(3)+P3d.Coord(3));
- Plate_PinpointConstraint PC(P2d.XY(),
- Pdif.XYZ(),0,0);
- myPlate.Load(PC);
-
- }
- else // le point n'appartient pas a un interval G1
- { if (k+1>=NbPtG1G1)
- { myPlateCont->ChangeValue(i).Append(Inter);
- // on ajoute le point
- }
- }
- }
- else
- { myPlateCont->ChangeValue(i).Append(Inter);
- // on ajoute le point
- }
- }
- }
- }
- else
- { if (NbPtG1G1!=0) // est qu'il existe un intervalle incompatible
- for(Standard_Integer k=1;k<=NbPtG1G1;k+=2)
- { if ((Inter>PntG1G1->Value(i).Value(k))
- &&(Inter<PntG1G1->Value(i).Value(k+1)))
- { k=NbPtG1G1+2; // pour sortir de la boucle
- // Ajouter les points de contrainte G0
- gp_Pnt P3d,PP,Pdif;
- gp_Pnt2d P2d;
-
- AC2d.D0(Inter, P2d);
- LinCont->D0(Inter,P3d);
- mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP);
- Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1),
- -PP.Coord(2)+P3d.Coord(2),
- -PP.Coord(3)+P3d.Coord(3));
- Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0);
- myPlate.Load(PC);
+ {
+ // repartition des points en cosinus selon l'ACR 2d
+ // Afin d'eviter les points d'acumulation dans le 2d
+ //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2);
+ if (j==NbPnt_i)
+ Inter=Ufinal;//pour parer au bug sur sun
+ else if (ACR) {
+ CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2;
+ Inter = acrlaw->Value(CurLength);
+ }
+ else {
+ Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2);
+ }
+ myParCont->ChangeValue(i).Append(Inter);// on ajoute le point
+ if (NbPtInter!=0)
+ {
+ for(Standard_Integer l=1;l<=NbPtInter;l+=2)
+ {
+ //on cherche si le point Inter est dans l'intervalle
+ //PntInter[i] PntInter[i+1]
+ //auquelle cas il ne faudrait pas le stocker (pb de doublons)
+ if ((Inter>PntInter->Value(i).Value(l))
+ &&(Inter<PntInter->Value(i).Value(l+1)))
+ {
+ l=NbPtInter+2;
+ // pour sortir de la boucle sans stocker le point
+ }
+ else
+ {
+ if (l+1>=NbPtInter) {
+ // on a parcouru tout le tableau : Le point
+ // n'appartient pas a un interval point commun
+ if (NbPtG1G1!=0)
+ {
+ // est qu'il existe un intervalle incompatible
+ for(Standard_Integer k=1;k<=NbPtG1G1;k+=2)
+ {
+ if ((Inter>PntG1G1->Value(i).Value(k))
+ &&(Inter<PntG1G1->Value(i).Value(k+1)))
+ {
+ k=NbPtG1G1+2; // pour sortir de la boucle
+ // Ajouter les points de contrainte G0
+ gp_Pnt P3d,PP,Pdif;
+ gp_Pnt2d P2d;
+
+ AC2d.D0(Inter, P2d);
+ LinCont->D0(Inter,P3d);
+ mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP);
+ Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1),
+ -PP.Coord(2)+P3d.Coord(2),
+ -PP.Coord(3)+P3d.Coord(3));
+ Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0);
+ myPlate.Load(PC);
+ }
+ else // le point n'appartient pas a un interval G1
+ {
+ if (k+1>=NbPtG1G1)
+ {
+ myPlateCont->ChangeValue(i).Append(Inter);
+ // on ajoute le point
+ }
+ }
+ }
+ }
+ else
+ {
+ myPlateCont->ChangeValue(i).Append(Inter);
+ // on ajoute le point
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ if (NbPtG1G1!=0) // est qu'il existe un intervalle incompatible
+ {
+ for(Standard_Integer k=1;k<=NbPtG1G1;k+=2)
+ {
+ if ((Inter>PntG1G1->Value(i).Value(k))
+ &&(Inter<PntG1G1->Value(i).Value(k+1)))
+ {
+ k=NbPtG1G1+2; // pour sortir de la boucle
+ // Ajouter les points de contrainte G0
+ gp_Pnt P3d,PP,Pdif;
+ gp_Pnt2d P2d;
+
+ AC2d.D0(Inter, P2d);
+ LinCont->D0(Inter,P3d);
+ mySurfInit->D0(P2d.Coord(1),P2d.Coord(2),PP);
+ Pdif.SetCoord(-PP.Coord(1)+P3d.Coord(1),
+ -PP.Coord(2)+P3d.Coord(2),
+ -PP.Coord(3)+P3d.Coord(3));
+ Plate_PinpointConstraint PC(P2d.XY(),Pdif.XYZ(),0,0);
+ myPlate.Load(PC);
- }
- else // le point n'appartient pas a un intervalle G1
- { if (k+1>=NbPtG1G1)
- { myPlateCont->ChangeValue(i).Append(Inter);
- // on ajoute le point
- }
- }
- }
- else
- { if ( ( (!mySurfInitIsGive)
- &&(Geom2dAdaptor_Curve(LinCont->Curve2dOnSurf()).GetType()!=GeomAbs_Circle))
- || ( (j>1) &&(j<NbPnt_i))) //on enleve les extremites
- myPlateCont->ChangeValue(i).Append(Inter);// on ajoute le point
- }
- }
+ }
+ else // le point n'appartient pas a un intervalle G1
+ {
+ if (k+1>=NbPtG1G1)
+ {
+ myPlateCont->ChangeValue(i).Append(Inter);
+ // on ajoute le point
+ }
+ }
+ }
+ }
+ else
+ {
+ if ( ( (!mySurfInitIsGive)
+ &&(Geom2dAdaptor_Curve(LinCont->Curve2dOnSurf()).GetType()!=GeomAbs_Circle))
+ || ( (j>1) &&(j<NbPnt_i))) //on enleve les extremites
+ myPlateCont->ChangeValue(i).Append(Inter);// on ajoute le point
+ }
}
+ }
}
}
//---------------------------------------------------------
Standard_Real Polemax=Polesinit(max).Y();
if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))){
if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y())
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
- if ((max==0)||(max==3))
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
- if ((max==1)||(max==2))
- if ((min==0)||(min==3))
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin));
- else{
- if ((TolPoles*Polemax<Polesinit(0).Y())&&(TolPoles*Polemax<Polesinit(3).Y())){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
- mark=1;
- }
- if ((1/TolPoles*Polemin>Polesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin));
- mark=1;
- }
- if (mark==0){
- Standard_Real Pole0,Pole3;
- Pole0=Polesinit(0).Y();
- Pole3=Polesinit(3).Y();
- if (Pole0<3){
- a=Log10(Pole3/Pole0);
- if (boucle==2)
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
- if (boucle==1){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
- dercas=1;
- }
- }
- if (Pole0>Pole3){
- a=Log10(Pole0/Pole3);
- if (boucle==2)
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
- if (boucle==1){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
- dercas=1;
- }
- }
- }
- }
+ Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ if ((max==0)||(max==3))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
+ }
+ else if ((max==1)||(max==2)) {
+ if ((min==0)||(min==3))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin));
+ }
+ else{
+ if ((TolPoles*Polemax<Polesinit(0).Y())&&(TolPoles*Polemax<Polesinit(3).Y())){
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
+ mark=1;
+ }
+ if ((1/TolPoles*Polemin>Polesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin));
+ mark=1;
+ }
+ if (mark==0){
+ Standard_Real Pole0,Pole3;
+ Pole0=Polesinit(0).Y();
+ Pole3=Polesinit(3).Y();
+ if (Pole0<3){
+ a=Log10(Pole3/Pole0);
+ if (boucle==2)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
+ }
+ if (boucle==1)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
+ dercas=1;
+ }
+ }
+ if (Pole0>Pole3)
+ {
+ a=Log10(Pole0/Pole3);
+ if (boucle==2)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
+ }
+ if (boucle==1)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
+ dercas=1;
+ }
+ }
+ }
+ }
+ }
}
- } //end of the loop
+ } // end of the loop
- if (!SignDenom(Polesinit)) //invertion of the polynome sign
+ if (!SignDenom(Polesinit)) //invertion of the polynome sign
+ {
for (index=0;index<=3;index++)
Polesinit(index).SetCoord(0.0,-Polesinit(index).Y());
-
- //loop of positivity
- if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)){
+ }
+
+ // loop of positivity
+ if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0))
+ {
Us1=Polesinit(0).Y()/(Polesinit(0).Y()-Polesinit(1).Y());
if (boucle==2)
Us1=Us1*knots(2);
U4=knots(I1);
}
- if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)){
+ if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0))
+ {
Us2=Polesinit(2).Y()/(Polesinit(2).Y()-Polesinit(3).Y());
if (boucle==2)
Us2=knots(knots.Length()-1)+Us2*(1-knots(knots.Length()-1));
}
if (I1==I2) //definition and filling of the
+ {
if((I3==I4)||(I3==0)){ //array of knots
Knots=new TColStd_HArray1OfReal(1,BS->NbKnots());
for (i=1;i<=BS->NbKnots();i++)
Knots->SetValue(i,BS->Knot(i));
Knots->SetValue(BS->NbKnots()+1,Uy);
}
- else{
+ }
+ else
+ {
if((I3==I4)||(I3==0)){
Knots=new TColStd_HArray1OfReal(1,BS->NbKnots()+1);
for (i=1;i<=BS->NbKnots();i++)
Polesinit(2).SetCoord(0.0,Herm(3)-Herm(2)/3.0);
Polesinit(3).SetCoord(0.0,Herm(3));
- //loop to check the tolerances on poles
- if (TolPoles!=0.0){
+ // loop to check the tolerances on poles
+ if (TolPoles!=0.0)
+ {
Polemax(Polesinit,min,max);
Standard_Real Polemin=Polesinit(min).Y();
Standard_Real Polemax=Polesinit(max).Y();
- if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles)))){
+ if (((Polemax)>=((1/TolPoles)*Polemin))||((Polemin==0.0)&&(Polemax>=(1/TolPoles))))
+ {
if (Polesinit(0).Y()>=(1/TolPoles)*Polesinit(3).Y()||Polesinit(0).Y()<=TolPoles*Polesinit(3).Y())
- Standard_DimensionError::Raise("Hermit Impossible Tolerance");
- if ((max==0)||(max==3))
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
- if ((max==1)||(max==2))
- if ((min==0)||(min==3))
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin));
- else{
- if ((TolPoles*Polemax<Polesinit(0).Y())&&(TolPoles*Polemax<Polesinit(3).Y())){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
- mark=1;
- }
- if ((1/TolPoles*Polemin>Polesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0)){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin));
- mark=1;
- }
- if (mark==0){
- Standard_Real Pole0,Pole3;
- Pole0=Polesinit(0).Y();
- Pole3=Polesinit(3).Y();
- if (Pole0<3){
- a=Log10(Pole3/Pole0);
- if (boucle==2)
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
- if (boucle==1){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
- dercas=1;
- }
- }
- if (Pole0>Pole3){
- a=Log10(Pole0/Pole3);
- if (boucle==2)
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
- if (boucle==1){
- for (i=0;i<=3;i++)
- Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
- dercas=1;
- }
- }
- }
- }
+ Standard_DimensionError::Raise("Hermit Impossible Tolerance");
+ if ((max==0)||(max==3))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
+ }
+ else if ((max==1)||(max==2))
+ {
+ if ((min==0)||(min==3))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-(1/TolPoles)*Polemin));
+ }
+ else
+ {
+ if ((TolPoles*Polemax<Polesinit(0).Y())&&(TolPoles*Polemax<Polesinit(3).Y()))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-TolPoles*Polemax));
+ mark=1;
+ }
+
+ if ((1/TolPoles*Polemin>Polesinit(0).Y())&&(1/TolPoles*Polemin>Polesinit(3).Y())&&(mark==0))
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0,(Polesinit(i).Y()-1/TolPoles*Polemin));
+ mark=1;
+ }
+ if (mark==0)
+ {
+ Standard_Real Pole0,Pole3;
+ Pole0=Polesinit(0).Y();
+ Pole3=Polesinit(3).Y();
+ if (Pole0<3)
+ {
+ a=Log10(Pole3/Pole0);
+ if (boucle==2)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
+ }
+ if (boucle==1)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
+ dercas=1;
+ }
+ }
+ if (Pole0>Pole3)
+ {
+ a=Log10(Pole0/Pole3);
+ if (boucle==2)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole0*(Pow(10.0,(-0.5*Log10(TolPoles)-a/2.0)))));
+ }
+ else if (boucle==1)
+ {
+ for (i=0;i<=3;i++)
+ Polesinit(i).SetCoord(0.0, Polesinit(i).Y()-(Pole3*(Pow(10.0,(a/2.0+0.5*Log10(TolPoles))))));
+ dercas=1;
+ }
+ }
+ }
+ }
+ }
}
- } //end of the loop
+ } // end of the loop
- if (!SignDenom(Polesinit)) //invertion of the polynome sign
+ if (!SignDenom(Polesinit)) // invertion of the polynome sign
+ {
for (index=0;index<=3;index++)
Polesinit(index).SetCoord(0.0,-Polesinit(index).Y());
-
- //boucle de positivite
- if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0)){
+ }
+
+ // boucle de positivite
+ if ((Polesinit(1).Y()<0.0)&&(Polesinit(2).Y()>=0.0))
+ {
Us1=Polesinit(0).Y()/(Polesinit(0).Y()-Polesinit(1).Y());
if (boucle==2)
Us1=Us1*knots(2);
U4=knots(I1);
}
- if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0)){
+ if ((Polesinit(1).Y()>=0.0)&&(Polesinit(2).Y()<0.0))
+ {
Us2=Polesinit(2).Y()/(Polesinit(2).Y()-Polesinit(3).Y());
if (boucle==2)
Us2=knots(knots.Length()-1)+Us2*(1-knots(knots.Length()-1));
else if (( surfcurv == -3 && len3d > 0) || len2d == 0)
GTranslate2d = Standard_False;
- if (GTranslate3d && GTranslate2d)
+ if (GTranslate3d && GTranslate2d) {
//Setting preference in the case of inconsitency between 3D and 2D
if (surfcurv == 2) Preferred3d = Standard_False;
else if (surfcurv == 3) Preferred2d = Standard_False;
else if (myfilepreference == 2) Preferred3d = Standard_False;
else if (myfilepreference == 3) Preferred2d = Standard_False;
else Preferred3d = Standard_False;
-
+ }
if (GTranslate3d && GTranslate2d && len3d != len2d) {
GTranslate3d = Preferred3d;
GTranslate2d = Preferred2d;
(const Handle(IGESDefs_AttributeTable)& ent,
const Interface_ShareTool& , Handle(Interface_Check)& ach) const
{
- if (ent->Definition().IsNull())
+ if (ent->Definition().IsNull()) {
if (ent->HasStructure()) ach->AddFail
("Structure in Directory Entry is not an Attribute Definition Table");
else ach->AddFail("No Attribute Definition defined");
+ }
if (ent->FormNumber() == 0 && ent->NbRows() != 1)
ach->AddFail("Form 0 with several Rows");
if (ent->NbAttributes() != ent->Definition()->NbAttributes())
else if (len2d == 0)
GTranslate2d = Standard_False;
- if (GTranslate3d && GTranslate2d)
+ if (GTranslate3d && GTranslate2d) {
//Setting preference in the case of inconsitency between 3D and 2D
if (myfilepreference == 2) Preferred3d = Standard_False;
else if (myfilepreference == 3) Preferred2d = Standard_False;
else Preferred3d = Standard_False;
-
+ }
if (GTranslate3d && GTranslate2d && len3d != len2d) {
GTranslate3d = Preferred3d;
GTranslate2d = Preferred2d;
}
if (!duplicate) {
- Standard_Integer ParamApproxOnLine = Standard_Integer(W1[ip])+1;
-
- arc->D1(paramarc,p2d,d2d);
- U1 = p2d.X(); V1 = p2d.Y();
- if (typL == IntPatch_Walking && SurfaceIsPeriodic)
- if (OnFirst)
- Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U1,V1,U2,V2);
- else
- Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U2,V2,U1,V1);
-
+ Standard_Integer ParamApproxOnLine = Standard_Integer(W1[ip])+1;
+
+ arc->D1(paramarc,p2d,d2d);
+ U1 = p2d.X(); V1 = p2d.Y();
+ if (typL == IntPatch_Walking && SurfaceIsPeriodic) {
+ if (OnFirst)
+ Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U1,V1,U2,V2);
+ else
+ Recadre(TypeS1,TypeS2,wlin,ParamApproxOnLine,U2,V2,U1,V1);
+ }
locpt.Append(ptsommet);
locpt2.Append(gp_Pnt2d(U2,V2));
else SP1.SetEdge1(-1);
}
else {
- PI=PE1+Edge*lambda;
- if(TriSurfID==1)
- if(Tri2.GetEdgeOrientation(EdgeIndex)>0)
- SP1.SetLambda2(lambda);
- else SP1.SetLambda2(1.0-lambda);
- if(TriSurfID==2)
- if(Tri1.GetEdgeOrientation(EdgeIndex)>0)
- SP1.SetLambda1(lambda);
- else SP1.SetLambda1(1.0-lambda);
-
+ PI=PE1+Edge*lambda;
+ if(TriSurfID==1) {
+ if(Tri2.GetEdgeOrientation(EdgeIndex)>0)
+ SP1.SetLambda2(lambda);
+ else SP1.SetLambda2(1.0-lambda);
+ }
+ if(TriSurfID==2) {
+ if(Tri1.GetEdgeOrientation(EdgeIndex)>0)
+ SP1.SetLambda1(lambda);
+ else SP1.SetLambda1(1.0-lambda);
+ }
}
Standard_Real Cote23X=Cote23.X();
ax3 : Ax3 from gp;
lin : Lin from gp;
+ typ : SurfaceType from GeomAbs;
prm1 : Real from Standard;
prm2 : Real from Standard;
prm3 : Real from Standard;
prm4 : Real from Standard;
ax3direc : Boolean from Standard;
- typ : SurfaceType from GeomAbs;
end Quadric;
TColStd_MapIteratorOfPackedMapOfInteger anIterN( anAllNodesMap );
for( ; anIterN.More(); anIterN.Next() )
- if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) )
+ if( myDataSource->GetGeom( anIterN.Key(), Standard_False, aCoords, NbNodes, aType ) ) {
if( first )
{
for( Standard_Integer i=1; i<=3; i++ )
if( aCoords( i )>max[i-1] )
max[i-1] = aCoords( i );
}
+ }
Bnd_Box box;
box.Add( gp_Pnt( min[0], min[1], min[2] ) );
box.Add( gp_Pnt( max[0], max[1], max[2] ) );
Standard_Integer& Vertices,
Standard_Integer& Bounds)
{
- if( !Topo.IsNull() )
+ if( !Topo.IsNull() ) {
if( AsPolygons || IsSelect )
{
Standard_Integer B = Topo->Upper()-Topo->Lower()+1;
Bounds += E;
Vertices += 2*E;
}
+ }
}
//================================================================
{
if (theIndex < 0 || theIndex > mySize)
Standard_OutOfRange::Raise();
- if (Other.mySize != 0)
+ if (Other.mySize != 0) {
if (theIndex == 0)
PPrepend (Other);
else {
myCurrentIndex += Other.mySize;
Other.Nullify();
}
+ }
}
//=======================================================================
const Standard_Boolean setUpdated)
{
NIS_InteractiveContext * aCtx = theDrawer->GetContext();
- if (myDrawer.IsNull() == Standard_False)
+ if (myDrawer.IsNull() == Standard_False) {
if (aCtx == 0L)
{
aCtx = myDrawer->GetContext();
(myDrawer->GetContext() != 0L && aCtx != myDrawer->GetContext(),
"NIS_InteractiveObject::SetDrawer: different drawer context");
}
+ }
Standard_NullValue_Raise_if
(aCtx == 0L, "NIS_InteractiveObject::SetDrawer: NULL drawer context");
myReleaseQueue (new OpenGl_ResourcesQueue()),
myGlLibHandle (NULL),
myGlCore20 (NULL),
- myMaxTexDim (1024),
myAnisoMax (1),
+ myMaxTexDim (1024),
myGlVerMajor (0),
myGlVerMinor (0),
myIsFeedback (Standard_False),
OpenGl_PrinterContext::OpenGl_PrinterContext()
: myProjTransform (0, 3, 0, 3),
myLayerViewportX (0),
- myLayerViewportY (0),
myScaleX (1.0f),
+ myLayerViewportY (0),
myScaleY (1.0f)
{
// identity projection matrix
myIntShadingMethod(TEL_SM_GOURAUD),
myAntiAliasing(Standard_False),
myTransPers(&myDefaultTransPers),
- myIsTransPers(Standard_False),
myTrihedron(NULL),
+ myIsTransPers(Standard_False),
myGraduatedTrihedron(NULL)
{
// Initialize matrices
if(Surf->IsVPeriodic() || Surf->IsVClosed()) {
vperiod = Surf->LastVParameter() - Surf->FirstVParameter();
}
- if(U0 < Uinf)
+ if(U0 < Uinf) {
if(!uperiod)
U0 = Uinf;
else {
decalU = int((Uinf - U0)/uperiod)+1;
U0 += decalU*uperiod;
}
- if(U0 > Usup)
+ }
+ if(U0 > Usup) {
if(!uperiod)
U0 = Usup;
else {
decalU = -(int((U0 - Usup)/uperiod)+1);
U0 += decalU*uperiod;
}
- if(V0 < Vinf)
+ }
+ if(V0 < Vinf) {
if(!vperiod)
V0 = Vinf;
else {
decalV = int((Vinf - V0)/vperiod)+1;
V0 += decalV*vperiod;
}
- if(V0 > Vsup)
+ }
+ if(V0 > Vsup) {
if(!vperiod)
V0 = Vsup;
else {
decalV = -int((V0 - Vsup)/vperiod)-1;
V0 += decalV*vperiod;
}
+ }
// The surface around U0 is reduced
Standard_Real uLittle = (Usup - Uinf)/10, vLittle = (Vsup - Vinf)/10;
case GeomAbs_Cylinder:
{
// Standard_Real Sloc, Tloc;
- Standard_Real Sloc;
- Standard_Integer usens = 0;
- gp_Cylinder Cylinder = Surf->Cylinder();
- ElSLib::Parameters( Cylinder, Pts(1), S, T);
- Pts2d(1).SetCoord(S,T);
- for ( i = 2 ; i <= NbOfPnts ; i++) {
- Sloc = S;
- ElSLib::Parameters( Cylinder, Pts(i), S, T);
- if(Abs(Sloc - S) > M_PI)
- if(Sloc > S)
- usens++;
- else
- usens--;
- Pts2d(i).SetCoord(S+usens*2*M_PI,T);
- }
- myProjIsDone = Standard_True;
- break;
+ Standard_Real Sloc;
+ Standard_Integer usens = 0;
+ gp_Cylinder Cylinder = Surf->Cylinder();
+ ElSLib::Parameters( Cylinder, Pts(1), S, T);
+ Pts2d(1).SetCoord(S,T);
+ for ( i = 2 ; i <= NbOfPnts ; i++) {
+ Sloc = S;
+ ElSLib::Parameters( Cylinder, Pts(i), S, T);
+ if(Abs(Sloc - S) > M_PI) {
+ if(Sloc > S)
+ usens++;
+ else
+ usens--;
+ }
+ Pts2d(i).SetCoord(S+usens*2*M_PI,T);
+ }
+ myProjIsDone = Standard_True;
+ break;
}
case GeomAbs_Cone:
{
// Standard_Real Sloc, Tloc;
- Standard_Real Sloc;
- Standard_Integer usens = 0;
- gp_Cone Cone = Surf->Cone();
- ElSLib::Parameters( Cone, Pts(1), S, T);
- Pts2d(1).SetCoord(S,T);
- for ( i = 2 ; i <= NbOfPnts ; i++) {
- Sloc = S;
- ElSLib::Parameters( Cone, Pts(i), S, T);
- if(Abs(Sloc - S) > M_PI)
- if(Sloc > S)
- usens++;
- else
- usens--;
- Pts2d(i).SetCoord(S+usens*2*M_PI,T);
- }
- myProjIsDone = Standard_True;
- break;
+ Standard_Real Sloc;
+ Standard_Integer usens = 0;
+ gp_Cone Cone = Surf->Cone();
+ ElSLib::Parameters( Cone, Pts(1), S, T);
+ Pts2d(1).SetCoord(S,T);
+ for ( i = 2 ; i <= NbOfPnts ; i++) {
+ Sloc = S;
+ ElSLib::Parameters( Cone, Pts(i), S, T);
+ if(Abs(Sloc - S) > M_PI) {
+ if(Sloc > S)
+ usens++;
+ else
+ usens--;
+ }
+ Pts2d(i).SetCoord(S+usens*2*M_PI,T);
+ }
+ myProjIsDone = Standard_True;
+ break;
}
case GeomAbs_Sphere:
{
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S;Tloc = T;
ElSLib::Parameters( Sphere, Pts(i), S, T);
- if(1.6*M_PI < Abs(Sloc - S))
+ if(1.6*M_PI < Abs(Sloc - S)) {
if(Sloc > S)
usens += 2;
else
usens -= 2;
+ }
if(1.6*M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*M_PI) {
vparit = !vparit;
if(Sloc > S)
for ( i = 2 ; i <= NbOfPnts ; i++) {
Sloc = S; Tloc = T;
ElSLib::Parameters( Torus, Pts(i), S, T);
- if(Abs(Sloc - S) > M_PI)
+ if(Abs(Sloc - S) > M_PI) {
if(Sloc > S)
usens++;
else
usens--;
- if(Abs(Tloc - T) > M_PI)
+ }
+ if(Abs(Tloc - T) > M_PI) {
if(Tloc > T)
vsens++;
else
vsens--;
+ }
Pts2d(i).SetCoord(S+usens*2*M_PI,T+vsens*2*M_PI);
}
myProjIsDone = Standard_True;
if (Dist2Min < DistTol3d * DistTol3d) {
//if (Dist2Min < Tol3d * Tol3d) {
(ext.Point(GoodValue)).Parameter(u,v);
- if(uperiod)
+ if(uperiod) {
if((U0 - u) > (2*uperiod/3)) {
usens++;
}
if((u - U0) > (2*uperiod/3)) {
usens--;
}
- if(vperiod)
+ }
+ if(vperiod) {
if((V0 - v) > (vperiod/2)) {
vsens++;
}
if((v - V0) > (vperiod/2)) {
vsens--;
}
+ }
U0 = u; V0 = v;
U1 = U0 + usens*uperiod;
V1 = V0 + vsens*vperiod;
if (aNext == 0) anEdgesIterator.Initialize(theMkGluing.Generated(aFullEdge));
else anEdgesIterator.Initialize(theMkGluing.Modified(aFullEdge));
for (;anEdgesIterator.More();anEdgesIterator.Next())
- if (anEdgesIterator.Value().ShapeType() == TopAbs_EDGE) {
- TopoDS_Edge aDivEdge = TopoDS::Edge(anEdgesIterator.Value());
- if (!TopExp::FirstVertex(aDivEdge).IsNull()) { // divided edge must have at least one vertex
- if (TopExp::FirstVertex(aFullEdge).IsNull()) AddToTheUnique(aDivEdge,aFullEdge);
- else if (!TopExp::LastVertex(aDivEdge).IsNull())//if full edge have at least one vertex, subedges must have two
- if (TopExp::LastVertex(aFullEdge).IsNull()) {
- if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()))
- AddToTheUnique(aDivEdge,aFullEdge);
- else if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion()))
- AddToTheUnique(aDivEdge,aFullEdge);
- } else {
- Standard_Integer aCounter = 0;
- if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) ||
- BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++;
- if (BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) ||
- BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)).
- IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++;
- if (aCounter!=2) AddToTheUnique(aDivEdge,aFullEdge);
- }
- }
- }
-
+ if (anEdgesIterator.Value().ShapeType() == TopAbs_EDGE) {
+ TopoDS_Edge aDivEdge = TopoDS::Edge(anEdgesIterator.Value());
+ if (!TopExp::FirstVertex(aDivEdge).IsNull()) { // divided edge must have at least one vertex
+ if (TopExp::FirstVertex(aFullEdge).IsNull()) AddToTheUnique(aDivEdge,aFullEdge);
+ else if (!TopExp::LastVertex(aDivEdge).IsNull()) {//if full edge have at least one vertex, subedges must have two
+ if (TopExp::LastVertex(aFullEdge).IsNull()) {
+ if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()))
+ AddToTheUnique(aDivEdge,aFullEdge);
+ else if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion()))
+ AddToTheUnique(aDivEdge,aFullEdge);
+ } else {
+ Standard_Integer aCounter = 0;
+ if (BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) ||
+ BRep_Tool::Pnt(TopExp::FirstVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++;
+ if (BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::FirstVertex(aDivEdge)),Precision::Confusion()) ||
+ BRep_Tool::Pnt(TopExp::LastVertex(aFullEdge)).
+ IsEqual(BRep_Tool::Pnt(TopExp::LastVertex(aDivEdge)),Precision::Confusion())) aCounter++;
+ if (aCounter!=2) AddToTheUnique(aDivEdge,aFullEdge);
+ }
+ }
+ }
+ }
}
}
aNext = 2;
const Standard_Boolean theAllowCutting,
const Standard_Boolean thePerformNow)
: BRepAlgoAPI_BooleanOperation (theS1,theS2, BOPAlgo_FUSE),
- myAllowCutting (theAllowCutting),
- myCompleted (Standard_False)
+ myCompleted (Standard_False),
+ myAllowCutting (theAllowCutting)
{
NotDone();
myGenerated.Clear();
myObjectToCut(theObjectToCut),
myFwdIsDone(Standard_False),
myRevIsDone(Standard_False),
- myMode(theMode),
myCut(NULL),
+ myMode(theMode),
myCommon(NULL)
{
do {
aFile.ReadLine(Buffer,BufSize,Len);
aLine += Buffer;
- if (aFile.IsAtEnd())
+ if (aFile.IsAtEnd()) {
if (!aLine.Length()) return 0;
else aLine += "\n";
+ }
} while (aLine.Value(aLine.Length()) != '\n');
return 1;
while ( !bnd.IsNull() ) {
Handle(Transfer_SimpleBinderOfTransient) bx =
Handle(Transfer_SimpleBinderOfTransient)::DownCast(bnd);
- if ( !bx.IsNull() )
+ if ( !bx.IsNull() ) {
// Single SDR is created for a non-manifold group (ssv: 12.11.2010)
if (!isManifold && i > 1)
break;
else
binder->AddResult( TransientResult( bx->Result() ) );
+ }
bnd = bnd->NextResult();
}
}
if (BRep_Tool::Degenerated(E)) di<<" DGNR";
if (sbwd->IsSeam(i)) di<<" SEAM_WIRE";
if (Shape.ShapeType() == TopAbs_FACE &&
- sae.IsSeam(E,TopoDS::Face(Shape))) di<<" SEAM_FACE";
- if (Shape.ShapeType() == TopAbs_FACE )
- if (sae.HasPCurve(E,TopoDS::Face(Shape))) di<<" PCU";
- else di<<" NO_PCU";
+ sae.IsSeam(E,TopoDS::Face(Shape))) di<<" SEAM_FACE";
+ if (Shape.ShapeType() == TopAbs_FACE ) {
+ if (sae.HasPCurve(E,TopoDS::Face(Shape))) di<<" PCU";
+ else di<<" NO_PCU";
+ }
if (sae.HasCurve3d(E)) di<<" C3D";
else di<<" NO_C3D";
if (sae.IsClosed3d(E)) di<<" CLOSED";
Standard_Real Umin, Umax, Vmin, Vmax;
S->Bounds ( Umin, Umax, Vmin, Vmax );
if ( Uf < Umin && ! S->IsUPeriodic() ) Uf = Umin;
- else if ( Uf > Umin )
+ else if ( Uf > Umin ) {
if ( Precision::IsInfinite(Umin) ) Uf -= 100;
else Uf = Umin;
+ }
if ( Vf < Vmin && ! S->IsVPeriodic() ) Vf = Vmin;
- else if ( Vf > Vmin )
+ else if ( Vf > Vmin ) {
if ( Precision::IsInfinite(Vmin) ) Vf -= 100;
else Vf = Vmin;
+ }
if ( Ul > Umax && ! S->IsUPeriodic() ) Ul = Umax;
- else if ( Ul < Umax )
+ else if ( Ul < Umax ) {
if ( Precision::IsInfinite(Umax) ) Ul += 100;
else Ul = Umax;
+ }
if ( Vl > Vmax && ! S->IsVPeriodic() ) Vl = Vmax;
- else if ( Vl < Vmax )
+ else if ( Vl < Vmax ) {
if ( Precision::IsInfinite(Vmax) ) Vl += 100;
else Vl = Vmax;
+ }
TColStd_SequenceOfReal uval;
TColStd_SequenceOfReal vval;
const Quantity_NameOfColor aColor,
const Standard_Integer aMode)
{
- if( HasSelectable() )
+ if( HasSelectable() ) {
if( IsAutoHilight() )
PM->Color(mySelectable,aColor,aMode);
else
mySelectable->HilightOwnerWithColor( PM, aColor, this );
+ }
}
void SelectMgr_EntityOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& PM,
for(Sel->Init();Sel->More();Sel->Next()){
SE = *((Handle(Select3D_SensitiveEntity)*) &(Sel->Sensitive()));
if(!SE.IsNull()){
- if(SE->HasLocation())
+ if(SE->HasLocation()) {
if( SE->Location()==myLocation){
SE->ResetLocation();
const Handle(SelectBasics_EntityOwner)& EO = SE->OwnerId();
SE->SetLocation(iniloc*myLocation.Inverted());
const Handle(SelectBasics_EntityOwner)& EO = SE->OwnerId();
(*((Handle(SelectMgr_EntityOwner)*)&EO))->SetLocation(SE->Location());}
-
+ }
}
}
Sel->UpdateStatus(SelectMgr_TOU_None);
Bnd_Box myLBox;
Handle (TopTools_HArray1OfShape) mySeq;
Standard_Boolean myShared;
- Standard_Integer myStatus;
Standard_Integer myNb;
TopoDS_Vertex myFVertex;
TopoDS_Vertex myLVertex;
Standard_Real myTol;
Standard_Real myMin3d;
TColStd_Array1OfInteger myArrIndices;
+ Standard_Integer myStatus;
+
};
#endif
else return Standard_False;
}
// Now, check these two edge to define a strip !
- if (!E1.IsNull()&&!E2.IsNull())
+ if (!E1.IsNull()&&!E2.IsNull()) {
if(!CheckStripEdges (E1,E2,tol,dmax)) return Standard_False;
- else {
- myStatusStrip = ShapeExtend::EncodeStatus (ShapeExtend_DONE3);
- return Standard_True ;
- }
+ else {
+ myStatusStrip = ShapeExtend::EncodeStatus (ShapeExtend_DONE3);
+ return Standard_True ;
+ }
+ }
return Standard_False;
}
}
//pdn correcting on periodic
- if(myCurve->IsClosed())
+ if(myCurve->IsClosed()) {
for(j = len; j >=1; j--)
- if(resKnots->Value(j) < maxPar)
- resKnots->SetValue(j,(To2d ? myAC3d.LastParameter() : myCurve->LastParameter())-(len-j)*preci);
+ if(resKnots->Value(j) < maxPar)
+ resKnots->SetValue(j,(To2d ? myAC3d.LastParameter() : myCurve->LastParameter())-(len-j)*preci);
else
- break;
+ break;
+ }
//pdn correction on range
for ( j=1; j <= len; j++ ) {
if ( resKnots->Value (j) < first ) resKnots->SetValue ( j, first );
Handle(Geom_RectangularTrimmedSurface)::DownCast ( S );
SS = RTS->BasisSurface();
}
- if(SS->IsKind(STANDARD_TYPE(Geom_OffsetSurface)))
+ if(SS->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
if(myOffsetMode)
return Standard_True;
else {
Handle(Geom_Surface) tmp;
return IsToConvert(basis,tmp);
}
+ }
if ( SS->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) )
return myExtrMode;
if ( SS->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)) )
}
}
if ( j < np ) { i = 0; break; } // not tangency
- if ( i == endInd )
+ if ( i == endInd ) {
if ( special <=0 ) break;
else special = -1;
+ }
}
if ( myClosedMode ) {
if ( code != IOR_UNDEF && ! begin ) {
if ( ::Precision::IsInfinite ( SUF ) || ::Precision::IsInfinite ( SUL ) ) {
if ( ::Precision::IsInfinite ( SUF ) ) SUF = fU1;
if ( ::Precision::IsInfinite ( SUL ) ) SUL = fU2;
- if(Abs(SUL-SUF) < ::Precision::PConfusion())
+ if(Abs(SUL-SUF) < ::Precision::PConfusion()) {
if ( ::Precision::IsInfinite ( SUF ) ) SUF-=1000.;
else SUL+=1000.;
+ }
}
if ( ::Precision::IsInfinite ( SVF ) || ::Precision::IsInfinite ( SVL ) ) {
if ( ::Precision::IsInfinite ( SVF ) ) SVF = fV1;
if ( ::Precision::IsInfinite ( SVL ) ) SVL = fV2;
- if(Abs(SVL-SVF) < ::Precision::PConfusion())
+ if(Abs(SVL-SVF) < ::Precision::PConfusion()) {
if ( ::Precision::IsInfinite ( SVF ) ) SVF-=1000.;
else SVL+=1000.;
+ }
}
URange = Abs ( SUL - SUF );
vf = pos1.Y();
}
}
- if ( skipU && skipV )
+ if ( skipU && skipV ) {
if ( i1 <= nb1 ) continue;
else break;
+ }
// or yet better - if it is end of some edges on both wires
for ( Standard_Integer i2 = 1; i1 <= nb1 && i2 <= nb2; i2++ ) {
TopoDS_Edge edge2 = wd2->Edge ( i2 );
SVMid = 0.5*(SVF+SVL);
if (uclosed) URange = Abs ( SUL - SUF );
else URange = RealLast();
- if (!IsVCrvClosed)
+ if (!IsVCrvClosed) {
if (vclosed) VRange = Abs ( SVL - SVF );
else VRange = RealLast();
+ }
Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange;
Handle(ShapeExtend_WireData) sbwdOring = WireData();
if (valueshape.IsNull()) SN++;
else SS++;
else if (keyshape.ShapeType() == TopAbs_FACE)
+ {
if (valueshape.IsNull()) FN++;
else if (valueshape.ShapeType() == TopAbs_SHELL) FS++;
else FF++;
+ }
}
// mapping
Standard_Integer SS = 0, SN = 0, FF = 0, FS = 0, FN = 0;
for (TopTools_DataMapIteratorOfDataMapOfShapeShape It (myContext->Map()); It.More(); It.Next()) {
TopoDS_Shape keyshape = It.Key(), valueshape = It.Value();
- if (keyshape.ShapeType() == TopAbs_SHELL)
+ if (keyshape.ShapeType() == TopAbs_SHELL) {
if (valueshape.IsNull()) SN++;
else SS++;
- else if (keyshape.ShapeType() == TopAbs_FACE)
+ }
+ else if (keyshape.ShapeType() == TopAbs_FACE) {
if (valueshape.IsNull()) FN++;
else if (valueshape.ShapeType() == TopAbs_SHELL) FS++;
else FF++;
+ }
}
Handle(Message_Messenger) aMessenger = myContext->Messenger();
else Valid = pdn->IsValidInTrans(Trans);
if (Valid)
+ {
if (Old) {
- if( pdn->myOld == RS && pdn->myNew != 0L && pdn->myNew != RS) {
- break;
- }
+ if( pdn->myOld == RS && pdn->myNew != 0L && pdn->myNew != RS) {
+ break;
+ }
}
else {
- if( pdn->myNew == RS && pdn->myOld != 0L && pdn->myOld != RS) {
- break;
- }
+ if( pdn->myNew == RS && pdn->myOld != 0L && pdn->myOld != RS) {
+ break;
+ }
}
+ }
pdn = pdn->NextSameShape(RS);
}
myNode = pdn;
TopClass_Classifier2d::TopClass_Classifier2d() :
myIsSet(Standard_False),
myFirstCompare(Standard_True),
- myIsHeadOrEnd(Standard_False), // skv OCC12627
- myState(TopAbs_UNKNOWN) // skv OCC12627
-
+ myState(TopAbs_UNKNOWN), // skv OCC12627
+ myIsHeadOrEnd(Standard_False) // skv OCC12627
{
}
// we take the state before of after orientations
before = ::FUN_getstate(myAng,myOri,AFTER,BEFORE);
// eap Mar 25 2002
- if (myTouchFlag)
+ if (myTouchFlag) {
if (before == TopAbs_OUT) before = TopAbs_IN;
else if (before == TopAbs_IN) before = TopAbs_OUT;
+ }
}
return before;
}
// looking back in before for defined states
after = ::FUN_getstate(myAng,myOri,BEFORE,AFTER);
// eap Mar 25 2002
- if (myTouchFlag)
+ if (myTouchFlag) {
if (after == TopAbs_OUT) after = TopAbs_IN;
else if (after == TopAbs_IN) after = TopAbs_OUT;
+ }
}
return after;
}
--MyColorScale : ColorScale from V3d;
MyLayerMgr : LayerMgr from V3d;
+ MyProjModel : TypeOfProjectionModel from V3d is protected;
+
-- the transformation between XoY and the grid plane
MyTrsf : Array2OfReal from TColStd;
MyGridEchoStructure : Structure from Graphic3d;
MyGridEchoGroup : Group from Graphic3d;
- MyProjModel : TypeOfProjectionModel from V3d is protected;
-
- MyTransparencyFlag : Boolean from Standard;
- myImmediateUpdate: Boolean from Standard is protected;
+ MyTransparencyFlag : Boolean from Standard;
+ myImmediateUpdate: Boolean from Standard is protected;
friends
SetViewOn from class Viewer from V3d ( me : mutable ),
const Handle(AIS_InteractiveObject) IO =
Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
if (!IO.IsNull()) {
- if(IO->Type()==AIS_KOI_Shape)
+ if(IO->Type()==AIS_KOI_Shape) {
if(IO->Signature()==0){
retsh = *((Handle(AIS_Shape)*)&IO);
}
else
cout << "an Object which is not an AIS_Shape "
"already has this name!!!"<<endl;
+ }
}
return retsh;
}
TCollection_AsciiString name = argv[2];
if(GetMapOfAIS().IsBound2(name)){
IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- if (!IO.IsNull())
+ if (!IO.IsNull()) {
if(On==1)
Ctx->SubIntensityOn(IO);
else
Ctx->SubIntensityOff(IO);
-
+ }
}
else return 1;
}
while ( it.More() ) {
const Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast(it.Key1());
- if (!ashape.IsNull())
+ if (!ashape.IsNull()) {
if(HaveToSet)
TheAISContext()->SetColor(ashape,ViewerTest::GetColorFromName(argv[1]),Standard_False);
else
TheAISContext()->UnsetColor(ashape,Standard_False);
+ }
it.Next();
}
TheAISContext()->UpdateCurrentViewer();
while ( it.More() ) {
Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast(it.Key1());
- if (!ashape.IsNull())
+ if (!ashape.IsNull()) {
if(HaveToSet)
TheAISContext()->SetTransparency(ashape,Draw::Atof(argv[1]),Standard_False);
else
TheAISContext()->UnsetTransparency(ashape,Standard_False);
+ }
it.Next();
}
TheAISContext()->UpdateCurrentViewer();
if ( ThereIsName && IsBound ) {
Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2(name));
- if (!ashape.IsNull())
+ if (!ashape.IsNull()) {
if (HaveToSet)
TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[2]));
else
TheAISContext()->UnsetMaterial(ashape);
+ }
}
//=======================================================================
// Il n'y a pas de nom de shape
while ( it.More() ) {
Handle(AIS_InteractiveObject) ashape =
Handle(AIS_InteractiveObject)::DownCast (it.Key1());
- if (!ashape.IsNull())
+ if (!ashape.IsNull()) {
if (HaveToSet)
TheAISContext()->SetMaterial(ashape,GetMaterialFromName(argv[1]),Standard_False);
else
TheAISContext()->UnsetMaterial(ashape,Standard_False);
+ }
it.Next();
}
TheAISContext()->UpdateCurrentViewer();
else if (!ThereIsCurrent && !ThereIsArgument){
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName
it(GetMapOfAIS());
- while ( it.More() ) {
- Handle(AIS_InteractiveObject) ashape =
- Handle(AIS_InteractiveObject)::DownCast (it.Key1());
- if (!ashape.IsNull())
- if (HaveToSet)
- TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False);
- else
- TheAISContext()->UnsetWidth(ashape,Standard_False);
- it.Next();
+ while ( it.More() ) {
+ Handle(AIS_InteractiveObject) ashape =
+ Handle(AIS_InteractiveObject)::DownCast (it.Key1());
+ if (!ashape.IsNull()) {
+ if (HaveToSet)
+ TheAISContext()->SetWidth(ashape,Draw::Atof(argv[1]),Standard_False);
+ else
+ TheAISContext()->UnsetWidth(ashape,Standard_False);
+ }
+ it.Next();
}
TheAISContext()->UpdateCurrentViewer();
}
ViewerTest_EventManager::ViewerTest_EventManager
(const Handle(V3d_View)& aView,
const Handle(AIS_InteractiveContext)& Ctx)
- : myView (aView),
- myCtx (Ctx),
+ : myCtx (Ctx),
+ myView (aView),
myX (-1),
myY (-1)
{}
Standard_Real myX1;
Standard_Real myY1;
- Standard_Real myHeight;
TCollection_AsciiString myText;
- TCollection_AsciiString myFontName;
+ Standard_Real myHeight;
+ Handle(Visual3d_Layer) myLayer;
Quantity_Color myColor;
Quantity_Color mySubtitleColor;
Aspect_TypeOfDisplayText myType;
- Handle(Visual3d_Layer) myLayer;
-
+ TCollection_AsciiString myFontName;
};
IMPLEMENT_STANDARD_HANDLE(V3d_TextItem, Visual3d_LayerItem)
private:
Standard_Real myX1, myY1, myX2, myY2;
+ V3d_LayerMgrPointer myLayerMgr;
+ Aspect_TypeOfLine myType;
Standard_Real myWidth;
Standard_Real myTransparency;
- Aspect_TypeOfLine myType;
- V3d_LayerMgrPointer myLayerMgr;
};
IMPLEMENT_STANDARD_HANDLE(V3d_LineItem, Visual3d_LayerItem)
:myShape(shape),myVoxels(&voxels),
myDeflection(deflection),
myNbX(nbx),myNbY(nby),myNbZ(nbz),
- myNbThreads(nbthreads),myIsBool(2),
+ myIsBool(2),myNbThreads(nbthreads),
myNbTriangles(0),
myUseExistingTriangulation(useExistingTriangulation)
{
:myShape(shape),myVoxels(&voxels),
myDeflection(deflection),
myNbX(nbx),myNbY(nby),myNbZ(nbz),
- myNbThreads(nbthreads),myIsBool(1),
+ myIsBool(1),myNbThreads(nbthreads),
myNbTriangles(0),
myUseExistingTriangulation(useExistingTriangulation)
{
:myShape(shape),myVoxels(&voxels),
myDeflection(deflection),
myNbX(nbx),myNbY(nby),myNbZ(nbz),
- myNbThreads(nbthreads),myIsBool(0),
+ myIsBool(0),myNbThreads(nbthreads),
myNbTriangles(0),
myUseExistingTriangulation(useExistingTriangulation)
{
// Match the name with the current word in the stream
if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "point"))
// Read the body of the data node (comma-separated list of duplets)
- if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
+ if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
if (theBuffer.LinePtr[0] != '[') // opening bracket
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) {
myLength = vecValues.Length();
if (myLength > 0) {
theBuffer.LinePtr++;
}
// Read the body of the data node (list of triplets)
- if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
+ if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
if (theBuffer.LinePtr[0] != '[') // opening bracket
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
if (OK(aStatus) && OK(aStatus, readBrace (theBuffer))) {
myLength = vecValues.Length();
if (myLength > 0) {
} else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "creaseAngle")) {
Standard_Real anAngle;
if (OK(aStatus, Scene().ReadReal (theBuffer, anAngle,
- Standard_False, Standard_False)))
+ Standard_False, Standard_False))) {
if (anAngle < -Precision::Confusion()*0.001)
aStatus = VrmlData_IrrelevantNumber;
else
myCreaseAngle = anAngle;
+ }
}
return aStatus;
}
VrmlData_ErrorStatus VrmlData_Node::readBrace (VrmlData_InBuffer& theBuffer)
{
VrmlData_ErrorStatus aStatus;
- if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer)))
+ if (OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
if (theBuffer.LinePtr[0] == '}')
theBuffer.LinePtr++;
else
aStatus = VrmlData_VrmlFormatError;
+ }
return aStatus;
}
theBuffer.Input.getline (theBuffer.Line, sizeof(theBuffer.Line));
theBuffer.LineCount++;
const int stat = theBuffer.Input.rdstate();
- if (stat & ios::badbit)
+ if (stat & ios::badbit) {
aStatus = VrmlData_UnrecoverableError;
- else if (stat & ios::failbit)
- if (stat & ios::eofbit)
+ }
+ else if (stat & ios::failbit) {
+ if (stat & ios::eofbit) {
aStatus = VrmlData_EndOfFile;
- else
+ }
+ else {
aStatus = VrmlData_GeneralError;
+ }
+ }
theBuffer.LinePtr = &theBuffer.Line[0];
theBuffer.IsProcessed = Standard_False;
}
TCollection_AsciiString aName;
// Read the DEF token to assign the node name
- if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
+ if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "DEF")) {
if (VrmlData_Node::OK(aStatus, ReadWord (theBuffer, aName)))
aStatus = ReadLine(theBuffer);
theNode.Nullify();
return aStatus;
}
+ }
const char * strName = aName.ToCString();
if (aStatus == VrmlData_StatusOK) {
aStatus = ReadWord (theBuffer, aTitle);
if (isProto) {
aStatus = ReadLine(theBuffer);
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (theBuffer.LinePtr[0] != '[')
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
}
if (aStatus == VrmlData_StatusOK)
aNode = new VrmlData_UnknownNode(* this,
}
aStatus = ReadLine(theBuffer);
if (aNode.IsNull() == Standard_False) {
- if (aNode->Name()[0] != '\0')
+ if (aNode->Name()[0] != '\0')
myNamedNodes.Add (aNode);
if (theType.IsNull() == Standard_False)
if (aNode->IsKind(theType) == Standard_False)
aStatus = VrmlData_VrmlFormatError;
}
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (theBuffer.LinePtr[0] == '{') {
theBuffer.LinePtr++;
theNode = aNode;
myAllNodes.Append(aNode);
- } else
+ } else {
aStatus = VrmlData_VrmlFormatError;
+ }
+ }
return aStatus;
}
theBuffer.LinePtr = endptr;
}
}
- if (aStatus == VrmlData_StatusOK)
- if (isScale)
+ if (aStatus == VrmlData_StatusOK) {
+ if (isScale) {
theXYZ.SetCoord (aVal[0] * myLinearScale,
aVal[1] * myLinearScale,
aVal[2] * myLinearScale);
- else
+ }
+ else {
theXYZ.SetCoord (aVal[0], aVal[1], aVal[2]);
+ }
+ }
return aStatus;
}
theBuffer.LinePtr = endptr;
}
}
- if (aStatus == VrmlData_StatusOK)
+ if (aStatus == VrmlData_StatusOK) {
if (isScale)
theXY.SetCoord (aVal[0] * myLinearScale, aVal[1] * myLinearScale);
else
theXY.SetCoord (aVal[0], aVal[1]);
+ }
return aStatus;
}
{
VrmlData_ErrorStatus aStatus;
theNBlocks = 0;
- if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer)))
+ if (VrmlData_Node::OK(aStatus, ReadLine(theBuffer))) {
if (theBuffer.LinePtr[0] != '[') // opening bracket
aStatus = VrmlData_VrmlFormatError;
else {
}
}
}
+ }
return aStatus;
}
const char * thePostfix) const
{
char buf[240];
- if (IsDummyWrite() == Standard_False)
+ if (IsDummyWrite() == Standard_False) {
if (isApplyScale && myLinearScale > Precision::Confusion())
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X() / myLinearScale,
theXYZ.Y() / myLinearScale, theXYZ.Z() / myLinearScale,
else
Sprintf (buf, "%.12g %.12g %.12g%s", theXYZ.X(), theXYZ.Y(), theXYZ.Z(),
thePostfix ? thePostfix : "");
+ }
return WriteLine (buf);
}
return Standard_False;
Handle(XCAFDoc_GraphNode) aSHUO;
// set the SHUO structure for this component if it is not exist
- if ( !ShapeTool()->FindSHUO( aLabels, aSHUO ) )
+ if ( !ShapeTool()->FindSHUO( aLabels, aSHUO ) ) {
if (aLabels.Length() == 1) {
// set color directly for component as NAUO
SetColor(aLabels.Value(1), color, type);
return Standard_True;
}
- else if ( !IsCreateSHUO || !ShapeTool()->SetSHUO( aLabels, aSHUO ) )
+ else if ( !IsCreateSHUO || !ShapeTool()->SetSHUO( aLabels, aSHUO ) ) {
return Standard_False;
+ }
+ }
TDF_Label aSHUOLabel = aSHUO->Label();
SetColor( aSHUOLabel, color, type );
return Standard_True;
Handle( MeshVS_MeshEntityOwner ) anOwner =
Handle( MeshVS_MeshEntityOwner )::DownCast( aContext->SelectedOwner() );
if( !anOwner.IsNull() )
+ {
if( anOwner->Type()==MeshVS_ET_Node )
+ {
aHiddenNodes->ChangeMap().Add( anOwner->ID() );
+ }
else
+ {
aHiddenElements->ChangeMap().Add( anOwner->ID() );
+ }
+ }
}
aContext->ClearSelected();
aMesh->SetHiddenNodes( aHiddenNodes );
Handle( MeshVS_MeshEntityOwner ) anOwner =
Handle( MeshVS_MeshEntityOwner )::DownCast( aContext->SelectedOwner() );
if( !anOwner.IsNull() )
+ {
if( anOwner->Type()==MeshVS_ET_Node )
+ {
aHiddenNodes->ChangeMap().Remove( anOwner->ID() );
+ }
else
+ {
aHiddenElements->ChangeMap().Remove( anOwner->ID() );
+ }
+ }
}
aMesh->SetHiddenNodes( aHiddenNodes );
aMesh->SetHiddenElems( aHiddenElements );