//=======================Pour les arcs======================
if(cu1.GetType() == GeomAbs_Circle) {
- BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
-// Handle(Geom_Circle) geom_circ1 = (Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
-//JR/Hp
Handle(Geom_Curve) aGeomCurve = BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
Handle(Geom_Circle) geom_circ1 = Handle(Geom_Circle)::DownCast (aGeomCurve) ;
// Handle(Geom_Circle) geom_circ1 = (const Handle(Geom_Circle)&) BRep_Tool::Curve(TopoDS::Edge(myFShape),F,L);
if(Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull())
return Standard_False;
-//#ifndef OCCT_DEBUG
- Handle(SelectMgr_SelectableObject) aSelectableObject = anObj->Selectable() ;
- return Handle(AIS_InteractiveObject)::DownCast (aSelectableObject)->Type()== myKind;
-//#else
-// return ((Handle(AIS_InteractiveObject)&)anObj->Selectable())->Type()== myKind;
-//#endif
+ Handle(AIS_InteractiveObject) anObject =
+ Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable());
+ return ! anObject.IsNull() && anObject->Type()== myKind;
}
while (itcr.More()) {
Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
- Handle(BRep_GCurve)& GC = Handle(BRep_GCurve)::DownCast (cr);
+ Handle(BRep_GCurve) GC (Handle(BRep_GCurve)::DownCast (cr));
if (GC->IsCurveOnClosedSurface() && Eisreversed)
return GC->PCurve2();
else
Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) {
Handle(Geom_Geometry) G = Bs->Copy();
- Handle(Geom_BSplineCurve)& Bsaux = Handle(Geom_BSplineCurve)::DownCast (G);
+ Handle(Geom_BSplineCurve) Bsaux (Handle(Geom_BSplineCurve)::DownCast (G));
Standard_Real u1 = U1, u2 = U2;
//// modified by jgv, 24.10.01 for BUC61031 ////
if (Bsaux->IsPeriodic())
}
case GeomAbs_Torus:
{
- Handle(Geom_ToroidalSurface)& S = Handle(Geom_ToroidalSurface)::DownCast (mySurface);
+ Handle(Geom_ToroidalSurface) S (Handle(Geom_ToroidalSurface)::DownCast (mySurface));
const Standard_Real R = S->MajorRadius() + S->MinorRadius();
if(R>Precision::Confusion())
Res = R3d/(2.*R);
}
case GeomAbs_Sphere:
{
- Handle(Geom_SphericalSurface)& S = Handle(Geom_SphericalSurface)::DownCast (mySurface);
+ Handle(Geom_SphericalSurface) S (Handle(Geom_SphericalSurface)::DownCast (mySurface));
const Standard_Real R = S->Radius();
if(R>Precision::Confusion())
Res = R3d/(2.*R);
}
case GeomAbs_Cylinder:
{
- Handle(Geom_CylindricalSurface)& S = Handle(Geom_CylindricalSurface)::DownCast (mySurface);
+ Handle(Geom_CylindricalSurface) S (Handle(Geom_CylindricalSurface)::DownCast (mySurface));
const Standard_Real R = S->Radius();
if(R>Precision::Confusion())
Res = R3d/(2.*R);
// Pas vraiment borne => resolution inconnue
return Precision::Parametric(R3d);
}
- Handle(Geom_ConicalSurface)& S = Handle(Geom_ConicalSurface)::DownCast (mySurface);
+ Handle(Geom_ConicalSurface) S (Handle(Geom_ConicalSurface)::DownCast (mySurface));
Handle(Geom_Curve) C = S->VIso(myVLast);
const Standard_Real Rayon1 = Handle(Geom_Circle)::DownCast (C)->Radius();
C = S->VIso(myVFirst);
}
case GeomAbs_Torus:
{
- Handle(Geom_ToroidalSurface)& S = Handle(Geom_ToroidalSurface)::DownCast (mySurface);
+ Handle(Geom_ToroidalSurface) S (Handle(Geom_ToroidalSurface)::DownCast (mySurface));
const Standard_Real R = S->MinorRadius();
if(R>Precision::Confusion())
Res = R3d/(2.*R);
}
case GeomAbs_Sphere:
{
- Handle(Geom_SphericalSurface)& S = Handle(Geom_SphericalSurface)::DownCast (mySurface);
+ Handle(Geom_SphericalSurface) S (Handle(Geom_SphericalSurface)::DownCast (mySurface));
const Standard_Real R = S->Radius();
if(R>Precision::Confusion())
Res = R3d/(2.*R);
const IntPatch_IType typl = L->ArcType();
if(typl == IntPatch_Analytic) {
Standard_Real u1,v1,u2,v2;
- Handle(IntPatch_ALine)& ALine = Handle(IntPatch_ALine)::DownCast (L);
+ Handle(IntPatch_ALine) ALine (Handle(IntPatch_ALine)::DownCast (L));
seqp.Clear();
nbvtx = GeomInt_LineTool::NbVertex(L);
for(i=1;i<nbvtx;i++) {
} // if(typl == IntPatch_Analytic) {
else if(typl == IntPatch_Walking) {
Standard_Real u1,v1,u2,v2;
- Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (L);
+ Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (L));
seqp.Clear();
nbvtx = GeomInt_LineTool::NbVertex(L);
for(i=1;i<nbvtx;i++) {
else if (typl != IntPatch_Restriction) {
seqp.Clear();
//
- Handle(IntPatch_GLine)& GLine = Handle(IntPatch_GLine)::DownCast (L);
+ Handle(IntPatch_GLine) GLine (Handle(IntPatch_GLine)::DownCast (L));
//
if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) {
TreatCircle(L, Tol);
IntPatch_IType aType;
//
aType=aLine->ArcType();
- Handle(IntPatch_GLine)& aGLine=Handle(IntPatch_GLine)::DownCast (aLine);
+ Handle(IntPatch_GLine) aGLine (Handle(IntPatch_GLine)::DownCast (aLine));
//
bRejected=RejectMicroCircle(aGLine, aType, aTol);
if (bRejected) {
if(nbp < 3)
return;
- Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (Line);
+ Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (Line));
Standard_Integer ip = 0, iv = 0;
gp_Pnt aPnt;
IntPatch_Point thePnt;
if(IType == IntPatch_Walking) nbw++;
else if(IType == IntPatch_Restriction) {
nbr++;
- Handle(IntPatch_RLine)& rlin =
- Handle(IntPatch_RLine)::DownCast (line);
+ Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (line));
if(rlin->IsArcOnS1()) nbr1++;
if(rlin->IsArcOnS2()) nbr2++;
}
nbllc++;
const Handle(IntPatch_Line)& LineK = LineConstructor.Line(k);
if (LineK->ArcType() == IntPatch_Analytic) {
- Handle(IntPatch_ALine)& alin =
- Handle(IntPatch_ALine)::DownCast (LineK);
+ Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (LineK));
nbvtx=alin->NbVertex();
nbva+=nbvtx; nba++;
for(v=1;v<=nbvtx;v++) {
}
}
else if (LineK->ArcType() == IntPatch_Restriction) {
- Handle(IntPatch_RLine)& rlin =
- Handle(IntPatch_RLine)::DownCast (LineK);
+ Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (LineK));
nbvtx=rlin->NbVertex();
nbvr+=nbvtx; nbr++;
for(v=1;v<=nbvtx;v++) {
}
}
else if (LineK->ArcType() == IntPatch_Walking) {
- Handle(IntPatch_WLine)& wlin =
- Handle(IntPatch_WLine)::DownCast (LineK);
+ Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (LineK));
nbvtx=wlin->NbVertex();
nbvw+=nbvtx; nbw++;
for(v=1;v<=nbvtx;v++) {
}
}
else {
- Handle(IntPatch_GLine)& glin =
- Handle(IntPatch_GLine)::DownCast (LineK);
+ Handle(IntPatch_GLine) glin (Handle(IntPatch_GLine)::DownCast (LineK));
nbvtx=glin->NbVertex();
nbvg+=nbvtx; nbg++;
for(v=1;v<=nbvtx;v++) {
switch (typl) {
case IntPatch_Analytic:
{
- Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
+ Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (L));
if (alin->HasFirstPoint()) {
firstp = alin->FirstPoint().ParameterOnLine();
}
case IntPatch_Restriction:
{
- Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
+ Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L));
if (rlin->HasFirstPoint()) {
firstp = rlin->FirstPoint().ParameterOnLine();
}
case IntPatch_Walking:
{
- Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
+ Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L));
if (wlin->HasFirstPoint()) {
firstp = wlin->FirstPoint().ParameterOnLine();
}
default:
{
- Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
+ Handle(IntPatch_GLine) glin (Handle(IntPatch_GLine)::DownCast (L));
if (glin->HasFirstPoint()) {
firstp = glin->FirstPoint().ParameterOnLine();
}
switch (typl) {
case IntPatch_Analytic:
{
- Handle(IntPatch_ALine)& alin = Handle(IntPatch_ALine)::DownCast (L);
+ Handle(IntPatch_ALine) alin (Handle(IntPatch_ALine)::DownCast (L));
if (alin->HasLastPoint()) {
lastp = alin->LastPoint().ParameterOnLine();
case IntPatch_Restriction:
{
- Handle(IntPatch_RLine)& rlin = Handle(IntPatch_RLine)::DownCast (L);
+ Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L));
if (rlin->HasLastPoint()) {
lastp = rlin->LastPoint().ParameterOnLine();
}
case IntPatch_Walking:
{
- Handle(IntPatch_WLine)& wlin = Handle(IntPatch_WLine)::DownCast (L);
+ Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L));
if (wlin->HasLastPoint()) {
lastp = wlin->LastPoint().ParameterOnLine();
default:
{
- Handle(IntPatch_GLine)& glin = Handle(IntPatch_GLine)::DownCast (L);
+ Handle(IntPatch_GLine) glin (Handle(IntPatch_GLine)::DownCast (L));
if (glin->HasLastPoint()) {
lastp = glin->LastPoint().ParameterOnLine();
IntPatch_IType typl = L->ArcType();
switch (typl) {
case IntPatch_Analytic: {
- Handle(IntPatch_ALine)& ALine = Handle(IntPatch_ALine)::DownCast (L);
+ Handle(IntPatch_ALine) ALine (Handle(IntPatch_ALine)::DownCast (L));
Handle(IntPatch_ALine) alig;
if(L->TransitionOnS1() == IntSurf_Undecided)
alig = new IntPatch_ALine(ALine->Curve(),L->IsTangent());
break;
}
case IntPatch_Walking: { //-- ****************************************
- Handle(IntPatch_WLine)& WLine = Handle(IntPatch_WLine)::DownCast (L);
+ Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (L));
const Handle(IntSurf_LineOn2S)& Lori = WLine->Curve();
Handle(IntSurf_LineOn2S) LineOn2S = new IntSurf_LineOn2S();
Standard_Integer ParamMinOnLine = (Standard_Integer) WLine->Vertex(i).ParameterOnLine();
break;
}
case IntPatch_Restriction: {
- Handle(IntPatch_RLine)& RLine = Handle(IntPatch_RLine)::DownCast (L);
+ Handle(IntPatch_RLine) RLine (Handle(IntPatch_RLine)::DownCast (L));
IndexLastVertex=2;
IndexFirstVertex=1;
Handle(IntPatch_RLine) rlig;
case IntPatch_Hyperbola:
case IntPatch_Circle:
case IntPatch_Ellipse: {
- Handle(IntPatch_GLine)& GLine = Handle(IntPatch_GLine)::DownCast (L);
+ Handle(IntPatch_GLine) GLine (Handle(IntPatch_GLine)::DownCast (L));
Handle(IntPatch_GLine) glig;
switch (typl) {
case IntPatch_Lin:
iv = indicesV1(i);
Handle(Adaptor2d_HCurve2d) arc;
if ((WLine->Vertex(iv).*pIsOnDomS)()) arc = (WLine->Vertex(iv).*pArcOnS)();
- else arc = (const Handle(Adaptor2d_HCurve2d)&) arcsResolved(iv);
+ else arc = Handle(Adaptor2d_HCurve2d)::DownCast (arcsResolved(iv));
if (!arc.IsNull()) mapArcsV1.Add(arc);
}
for (i=1; i <= indicesV2.Length(); i++) {
iv = indicesV2(i);
Handle(Adaptor2d_HCurve2d) arc;
if ((WLine->Vertex(iv).*pIsOnDomS)()) arc = (WLine->Vertex(iv).*pArcOnS)();
- else arc = (const Handle(Adaptor2d_HCurve2d)&) arcsResolved(iv);
+ else arc = Handle(Adaptor2d_HCurve2d)::DownCast (arcsResolved(iv));
if (!arc.IsNull() && mapArcsV1.Contains(arc)) mapArcs.Add(arc);
}
// for each common arc
for (Standard_Integer ia=1; ia <= mapArcs.Extent(); ia++) {
- const Handle(Adaptor2d_HCurve2d)& arc = (const Handle(Adaptor2d_HCurve2d)&) mapArcs(ia);
+ const Handle(Adaptor2d_HCurve2d) arc (Handle(Adaptor2d_HCurve2d)::DownCast (mapArcs(ia)));
// get end vertices of wline linked with this arc
Standard_Integer iv1=0,iv2=0;
for (i=1; i <= indicesV1.Length() && iv1==0; i++) {
iv = indicesV1(i);
Handle(Adaptor2d_HCurve2d) arc1;
if ((WLine->Vertex(iv).*pIsOnDomS)()) arc1 = (WLine->Vertex(iv).*pArcOnS)();
- else arc1 = (const Handle(Adaptor2d_HCurve2d)&) arcsResolved(iv);
+ else arc1 = Handle(Adaptor2d_HCurve2d)::DownCast (arcsResolved(iv));
if (!arc1.IsNull() && arc1 == arc) iv1 = iv;
}
for (i=1; i <= indicesV2.Length() && iv2==0; i++) {
iv = indicesV2(i);
Handle(Adaptor2d_HCurve2d) arc1;
if ((WLine->Vertex(iv).*pIsOnDomS)()) arc1 = (WLine->Vertex(iv).*pArcOnS)();
- else arc1 = (const Handle(Adaptor2d_HCurve2d)&) arcsResolved(iv);
+ else arc1 = Handle(Adaptor2d_HCurve2d)::DownCast (arcsResolved(iv));
if (!arc1.IsNull() && arc1 == arc) iv2 = iv;
}
if (!iv1 || !iv2) {
IntPatch_IType typl = L->ArcType();
if(typl == IntPatch_Analytic) {
Standard_Real u1,v1,u2,v2;
- Handle(IntPatch_ALine)& ALine
- = Handle(IntPatch_ALine)::DownCast (L);
+ Handle(IntPatch_ALine) ALine (Handle(IntPatch_ALine)::DownCast (L));
slin.Clear();
nbvtx = ALine->NbVertex();
//-- -------------------------------------------------------------------
}
else if(typl == IntPatch_Walking) {
Standard_Real u1,v1,u2,v2;
- Handle(IntPatch_WLine)& WLine
- = Handle(IntPatch_WLine)::DownCast (L);
+ Handle(IntPatch_WLine) WLine (Handle(IntPatch_WLine)::DownCast (L));
slin.Clear();
nbvtx = WLine->NbVertex();
//-- -------------------------------------------------------------------
}
else if (typl != IntPatch_Restriction) { // JAG 01.07.96
Standard_Real u1,v1,u2,v2;
- Handle(IntPatch_GLine)& GLine
- = Handle(IntPatch_GLine)::DownCast (L);
+ Handle(IntPatch_GLine) GLine (Handle(IntPatch_GLine)::DownCast (L));
slin.Clear();
nbvtx = GLine->NbVertex();
//-- -------------------------------------------------------------------
return;
}
else { //-- Restriction
- Handle(IntPatch_RLine)& RLine
- = Handle(IntPatch_RLine)::DownCast (L);
+ Handle(IntPatch_RLine) RLine (Handle(IntPatch_RLine)::DownCast (L));
slin.Clear();
Standard_Integer NbVtx = RLine->NbVertex();
Standard_Boolean RestOnS1 = RLine->IsArcOnS1();
BRepAdaptor_Curve CURVE(OE);
if (CURVE.GetType() == GeomAbs_Line) {
// Works only with line !!
-//#ifndef OCCT_DEBUG
Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
gp_Lin OLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
-//#else
-// gp_Lin OLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
TopoDS_Edge NE = TopoDS::Edge(S2);
CURVE.Initialize (NE);
-//#ifndef OCCT_DEBUG
aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
gp_Lin NLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
-//#else
-// gp_Lin NLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
gp_Dir TDir (NLin.Location().XYZ() - OLin.Location().XYZ());
aplane = new Geom_Plane (NLin.Location(),NLin.Direction()^TDir);
}
else
if (CURVE.GetType() == GeomAbs_Circle) {
-//#ifndef OCCT_DEBUG
Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
gp_Ax1 ax = Handle(Geom_Circle)::DownCast (aGeomGeometry)->Circ().Axis();
-//#else
-// gp_Ax1 ax = ((Handle(Geom_Circle)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Circ().Axis();
-//#endif
aplane = new Geom_Plane (ax.Location(),ax.Direction());
is_planar = Standard_True;
}
BRepBuilderAPI_MakeFace MkF (w1,Standard_True);
if (MkF.IsDone()) {
-//#ifndef OCCT_DEBUG
Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(MkF.Face());
- aplane = Handle(Geom_Plane)::DownCast (aGeomSurface) ;
-//#else
-// aplane = ((Handle(Geom_Plane)&) BRep_Tool::Surface(MkF.Face()));
-//#endif
+ aplane = Handle(Geom_Plane)::DownCast (aGeomSurface);
is_planar = Standard_True;
}
}
Standard_Integer iparmin = (Standard_Integer)parmin;
Standard_Integer iparmax = (Standard_Integer)parmax;
- Handle(Geom_BSplineCurve)& HC3D = Handle(Geom_BSplineCurve)::DownCast (C3D);
- Handle(Geom2d_BSplineCurve)& HPC1 = Handle(Geom2d_BSplineCurve)::DownCast (PC1);
- Handle(Geom2d_BSplineCurve)& HPC2 = Handle(Geom2d_BSplineCurve)::DownCast (PC2);
+ Handle(Geom_BSplineCurve) HC3D (Handle(Geom_BSplineCurve)::DownCast (C3D));
+ Handle(Geom2d_BSplineCurve) HPC1 (Handle(Geom2d_BSplineCurve)::DownCast (PC1));
+ Handle(Geom2d_BSplineCurve) HPC2 (Handle(Geom2d_BSplineCurve)::DownCast (PC2));
//--------------------- IFV - "improving" initial curves
#ifdef CurveImprovement
if(CompPC1) Polpc1(NbPol) = PolPC1(nbpol);
if(CompPC2) Polpc2(NbPol) = PolPC2(nbpol);
- HC3D = new Geom_BSplineCurve(Polc3d, knots, mults, 1);
- if(CompPC1) HPC1 = new Geom2d_BSplineCurve(Polpc1, knots, mults, 1);
- if(CompPC2) HPC2 = new Geom2d_BSplineCurve(Polpc2, knots, mults, 1);
+ const_cast<Handle(Geom_Curve)&>(C3D) = new Geom_BSplineCurve(Polc3d, knots, mults, 1);
+ if(CompPC1) const_cast<Handle(Geom2d_Curve)&>(PC1) = new Geom2d_BSplineCurve(Polpc1, knots, mults, 1);
+ if(CompPC2) const_cast<Handle(Geom2d_Curve)&>(PC2) = new Geom2d_BSplineCurve(Polpc2, knots, mults, 1);
iparmax = NbPol;
#ifdef IFV
sprintf(name,"C3Dmod_%d",NbCalls);
nm = &name[0];
- DrawTrSurf::Set(nm, HC3D);
+ DrawTrSurf::Set(nm, C3D);
sprintf(name,"PC1mod_%d",NbCalls);
nm = &name[0];
- DrawTrSurf::Set(nm, HPC1);
+ DrawTrSurf::Set(nm, PC1);
sprintf(name,"PC2mod_%d",NbCalls);
nm = &name[0];
- DrawTrSurf::Set(nm, HPC2);
+ DrawTrSurf::Set(nm, PC2);
#endif
}
}
void V3d_Viewer::ClearCurrentSelectedLight() {
- MyCurrentSelectedLight = NULL;
+ MyCurrentSelectedLight.Nullify();
}
{
while (MyDefinedLights.Extent() > 0)
{
- DelLight ((Handle(V3d_Light)&)MyDefinedLights.First());
+ DelLight (Handle(V3d_Light)::DownCast (MyDefinedLights.First()));
}
SetLightOn (new V3d_DirectionalLight (this, V3d_Zneg, Quantity_NOC_WHITE, Standard_True));