Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const
{
- if (Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull()) return Standard_False;
+ Handle(AIS_InteractiveObject) aSelectable (Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable()));
+ if (aSelectable.IsNull())
+ return Standard_False;
+
Standard_Boolean okstat = Standard_True;
-
-//#ifndef OCCT_DEBUG
- Handle(SelectMgr_SelectableObject) aSelectable = anObj->Selectable() ;
- if( hasC && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasColor() )
-//#else
-// if(hasC && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasColor())
-//#endif
+ if( hasC && aSelectable->HasColor() )
okstat = (myCol == Handle(AIS_InteractiveObject)::DownCast (anObj)->Color());
-//#ifndef OCCT_DEBUG
- aSelectable = anObj->Selectable() ;
- if( hasW && Handle(AIS_InteractiveObject)::DownCast (aSelectable)->HasWidth() )
-//#else
-// if(hasW && ((Handle(AIS_InteractiveObject)&) anObj->Selectable())->HasWidth())
-//#endif
+ if( hasW && aSelectable->HasWidth() )
okstat = (myWid == Handle(AIS_InteractiveObject)::DownCast (anObj)->Width()) && okstat;
return okstat;
-
}
Standard_Boolean AIS_BadEdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
{
- if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull())
+ if (myContour==0)
return Standard_True;
- if (myContour==0)
+ Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO));
+ if (aBO.IsNull())
return Standard_True;
- const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
+ const TopoDS_Shape& aShape = aBO->Shape();
if (myBadEdges.IsBound(myContour)) {
TopTools_ListIteratorOfListOfShape it(myBadEdges.Find(myContour));
Standard_Boolean AIS_C0RegularityFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
{
- if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull())
+ Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO));
+ if (aBO.IsNull())
return Standard_False;
- const TopoDS_Shape& aShape = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
+ const TopoDS_Shape& aShape = aBO->Shape();
if(aShape.ShapeType()!= TopAbs_EDGE)
return Standard_False;
return Dr->VectorAspect();
break;
case AIS_TOA_UIso:
- return Dr->UIsoAspect();
+ return Handle(Prs3d_LineAspect) (Dr->UIsoAspect());
break;
case AIS_TOA_VIso:
- return Dr->VIsoAspect();
+ return Handle(Prs3d_LineAspect) (Dr->VIsoAspect());
break;
case AIS_TOA_Free:
return Dr->FreeBoundaryAspect();
//=======================================================================
Standard_Boolean AIS_LocalContext::IsShape(const Standard_Integer Index) const
{
-
- if(Handle(StdSelect_BRepOwner)::DownCast(myMapOfOwner->FindKey(Index)).IsNull())
+ Handle(SelectMgr_EntityOwner) aEO (myMapOfOwner->FindKey(Index));
+ if (aEO.IsNull() || ! aEO->IsKind(STANDARD_TYPE(StdSelect_BRepOwner)))
return Standard_False;
return
ComesFromDecomposition(Index);
myDrawer->DatumAspect()->SetAxisLength(aValue,aValue,aValue);
for(Standard_Integer i=4;i<=6;i++)
- (*((Handle(AIS_Plane)*)&myShapes[i]))->SetSize(aValue);
+ Handle(AIS_Plane)::DownCast (myShapes[i])->SetSize(aValue);
Update();
UpdateSelection();
Standard_Boolean AIS_TypeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const
{
- if(Handle(AIS_InteractiveObject)::DownCast(anObj->Selectable()).IsNull())
- return Standard_False;
-
Handle(AIS_InteractiveObject) anObject =
Handle(AIS_InteractiveObject)::DownCast (anObj->Selectable());
return ! anObject.IsNull() && anObject->Type()== myKind;
#ifndef _Adaptor3d_TopolTool_HeaderFile
#define _Adaptor3d_TopolTool_HeaderFile
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <Standard_Integer.hxx>
-#include <Standard_Real.hxx>
#include <TColStd_HArray1OfReal.hxx>
-#include <MMgt_TShared.hxx>
-#include <Standard_Boolean.hxx>
#include <TopAbs_State.hxx>
#include <TopAbs_Orientation.hxx>
#include <TColStd_Array1OfReal.hxx>
-#include <Standard_Address.hxx>
+#include <Adaptor3d_HVertex.hxx>
+
class Adaptor2d_HLine2d;
class Adaptor3d_HVertex;
class Adaptor3d_HSurface;
#include <TColgp_HArray1OfVec.hxx>
#include <TColgp_HArray1OfVec2d.hxx>
-#define tabTang Handle(TColgp_HArray1OfVec)::DownCast (ttabTang)
-#define tabCurv Handle(TColgp_HArray1OfVec)::DownCast (ttabCurv)
-#define tabTang2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabTang2d)
-#define tabCurv2d Handle(TColgp_HArray1OfVec2d)::DownCast (ttabCurv2d)
-
-
-
-
AppDef_MultiPointConstraint::AppDef_MultiPointConstraint() {}
(tabCur2d.Length() != tabP2d.Length())) {
Standard_ConstructionError::Raise();
}
- Handle(TColgp_HArray1OfVec) T3d =
- new TColgp_HArray1OfVec(1, tabVec.Length());
- ttabTang = T3d;
-
- Handle(TColgp_HArray1OfVec2d) T2d =
- new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
- ttabTang2d = T2d;
+ tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
+ tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1));
}
- Handle(TColgp_HArray1OfVec) C3d =
- new TColgp_HArray1OfVec(1, tabCur.Length());
- ttabCurv = C3d;
-
- Handle(TColgp_HArray1OfVec2d) C2d =
- new TColgp_HArray1OfVec2d(1, tabCur2d.Length());
- ttabCurv2d = C2d;
+ tabCurv = new TColgp_HArray1OfVec(1, tabCur.Length());
+ tabCurv2d = new TColgp_HArray1OfVec2d(1, tabCur2d.Length());
Lower = tabCur.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
}
-
AppDef_MultiPointConstraint::AppDef_MultiPointConstraint
(const TColgp_Array1OfPnt& tabP,
const TColgp_Array1OfPnt2d& tabP2d,
const TColgp_Array1OfVec& tabVec,
const TColgp_Array1OfVec2d& tabVec2d):
- AppParCurves_MultiPoint(tabP, tabP2d) {
+ AppParCurves_MultiPoint(tabP, tabP2d)
+{
if ((tabP.Length() != tabVec.Length()) ||
(tabP2d.Length() != tabVec2d.Length())) {
Standard_ConstructionError::Raise();
}
-
- Handle(TColgp_HArray1OfVec) T3d =
- new TColgp_HArray1OfVec(1, tabVec.Length());
- ttabTang = T3d;
-
- Handle(TColgp_HArray1OfVec2d) T2d =
- new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
- ttabTang2d = T2d;
+ tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
+ tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
if (tabP.Length() != tabVec.Length()) {
Standard_ConstructionError::Raise();
}
- Handle(TColgp_HArray1OfVec) T3d =
- new TColgp_HArray1OfVec(1, tabVec.Length());
- ttabTang = T3d;
+
+ tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
Standard_Integer i, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
(tabP.Length() != tabCur.Length())) {
Standard_ConstructionError::Raise();
}
- Handle(TColgp_HArray1OfVec) T3d =
- new TColgp_HArray1OfVec(1, tabVec.Length());
- ttabTang = T3d;
+ tabTang = new TColgp_HArray1OfVec(1, tabVec.Length());
Standard_Integer i, Lower = tabVec.Lower();
for (i = 1; i <= tabVec.Length(); i++) {
tabTang->SetValue(i, tabVec.Value(Lower+i-1));
}
- Handle(TColgp_HArray1OfVec) C3d =
- new TColgp_HArray1OfVec(1, tabCur.Length());
- ttabCurv = C3d;
-
+ tabCurv = new TColgp_HArray1OfVec(1, tabCur.Length());
Lower = tabCur.Lower();
for (i = 1; i <= tabCur.Length(); i++) {
tabCurv->SetValue(i, tabCur.Value(Lower+i-1));
Standard_ConstructionError::Raise();
}
- Handle(TColgp_HArray1OfVec2d) T2d =
- new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
- ttabTang2d = T2d;
-
+ tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec2d.Lower();
for (i = 1; i <= tabVec2d.Length(); i++) {
tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1));
(tabCur2d.Length() != tabP2d.Length())) {
Standard_ConstructionError::Raise();
}
- Handle(TColgp_HArray1OfVec2d) T2d =
- new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
- ttabTang2d = T2d;
-
+
+ tabTang2d = new TColgp_HArray1OfVec2d(1, tabVec2d.Length());
Standard_Integer i, Lower = tabVec2d.Lower();
for (i = 1; i <= tabVec2d.Length(); i++) {
tabTang2d->SetValue(i, tabVec2d.Value(Lower+i-1));
}
- Handle(TColgp_HArray1OfVec2d) C2d =
- new TColgp_HArray1OfVec2d(1, tabCur2d.Length());
- ttabCurv2d = C2d;
-
+ tabCurv2d = new TColgp_HArray1OfVec2d(1, tabCur2d.Length());
Lower = tabCur2d.Lower();
for (i = 1; i <= tabCur2d.Length(); i++) {
tabCurv2d->SetValue(i, tabCur2d.Value(Lower+i-1));
#include <Standard_Handle.hxx>
#include <AppParCurves_MultiPoint.hxx>
-#include <Standard_Integer.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
-#include <TColgp_Array1OfVec.hxx>
-#include <TColgp_Array1OfVec2d.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_OStream.hxx>
-class MMgt_TShared;
+#include <TColgp_HArray1OfVec.hxx>
+#include <TColgp_HArray1OfVec2d.hxx>
+
class Standard_OutOfRange;
class Standard_ConstructionError;
class Standard_DimensionError;
class gp_Vec;
class gp_Vec2d;
-
//! Describes a MultiPointConstraint used in a
//! Multiline. MultiPointConstraints are composed
//! of several two or three-dimensional points.
//! Is used to redefine the operator <<.
Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE;
-
-
-
-protected:
-
-
-
-
-
private:
-
-
-
- Handle(MMgt_TShared) ttabTang;
- Handle(MMgt_TShared) ttabCurv;
- Handle(MMgt_TShared) ttabTang2d;
- Handle(MMgt_TShared) ttabCurv2d;
-
-
+ Handle(TColgp_HArray1OfVec) tabTang;
+ Handle(TColgp_HArray1OfVec) tabCurv;
+ Handle(TColgp_HArray1OfVec2d) tabTang2d;
+ Handle(TColgp_HArray1OfVec2d) tabCurv2d;
};
-
-
-
-
-
-
#endif // _AppDef_MultiPointConstraint_HeaderFile
const TopoDS_Edge& aEnew,
const Handle(IntTools_Context)& aCtx)
{
- Standard_Boolean bRet, bFlag, bIsDegenerated;
+ Standard_Boolean bRet, bIsDegenerated;
Standard_Real aTnew, aTold, aScPr, aTa, aTb, aT1, aT2;
gp_Vec aVold, aVnew, aVE, aVS;
gp_Pnt aP;
aCnew->D1(aTnew, aP, aVnew);
aVnew.Normalize();
//
- bFlag=aCtx->ProjectPointOnEdge(aP, aEold, aTold);
+ aCtx->ProjectPointOnEdge(aP, aEold, aTold);
aCold->D1(aTold, aP, aVold);
aVold.Normalize();
//
#include <Standard_Handle.hxx>
#include <TopoDS_Builder.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
#include <GeomAbs_Shape.hxx>
+#include <Poly_Polygon3D.hxx>
+#include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangulation.hxx>
+
class Standard_NullObject;
class Standard_DomainError;
class TopoDS_Face;
//purpose : face SameDomaine or not
//=======================================================================
-Standard_Boolean ToFuse(const TopoDS_Face& F1,
- const TopoDS_Face& F2)
+static Standard_Boolean ToFuse (const TopoDS_Face& F1, const TopoDS_Face& F2)
{
if (F1.IsNull() || F2.IsNull()) {
return Standard_False;
Standard_Boolean ValRet = Standard_False;
if (typS1 == STANDARD_TYPE(Geom_Plane)) {
- S1 = BRep_Tool::Surface(F1); // to apply the location.
- S2 = BRep_Tool::Surface(F2);
gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
+ // apply locations
+ if (! loc1.IsIdentity())
+ pl1.Transform (loc1.Transformation());
+ if (! loc2.IsIdentity())
+ pl2.Transform (loc2.Transformation());
+
if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
ValRet = Standard_True;
}
Standard_Real U1,U2;
TopoDS_Vertex V1,V2;
- Handle(Geom2d_Curve) Bis = Bisec.Value();
+ Handle(Geom2d_Curve) Bis (Bisec.Value());
U1 = Bis->FirstParameter();
{
Reverse = Standard_False;
- Handle(Geom2d_Curve) Bis = theTool.GeomBis(anArc->GeomIndex()).Value();
+ Handle(Geom2d_Curve) Bis (theTool.GeomBis(anArc->GeomIndex()).Value());
if (Bis->FirstParameter() <= -Precision::Infinite()) {
Reverse = Standard_True;
Standard_Real length = Pfirst.Distance(Pint1);
if (OffsetOutside)
{
- TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
- GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
- Standard_True, Standard_False);
+ Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
+ GeomLib::ExtendSurfByLength (aSurf, length, 1, Standard_True, Standard_False);
+ TheSurf = aSurf;
Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( u1, u2, v1, v2 );
MinApex = TheSurf->Value( u1, vf1 );
Standard_Real length = Pfirst.Distance(Pint1);
if (OffsetOutside)
{
- TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
- GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
- Standard_True, Standard_True);
+ Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
+ GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_True, Standard_True);
+ TheSurf = aSurf;
Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( u1, u2, v1, v2 );
MaxApex = TheSurf->Value( u2, vf1 );
Standard_Real length = Pfirst.Distance(Pint1);
if (OffsetOutside)
{
- TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
- GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
- Standard_False, Standard_False);
+ Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
+ GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_False, Standard_False);
+ TheSurf = aSurf;
Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( u1, u2, v1, v2 );
MinApex = TheSurf->Value( uf1, v1 );
Standard_Real length = Pfirst.Distance(Pint1);
if (OffsetOutside)
{
- TheSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
- GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)::DownCast (TheSurf), length, 1,
- Standard_False, Standard_True);
+ Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface(TheSurf, uf1, uf2, vf1, vf2);
+ GeomLib::ExtendSurfByLength(aSurf, length, 1, Standard_False, Standard_True);
+ TheSurf = aSurf;
Standard_Real u1, u2, v1, v2;
TheSurf->Bounds( u1, u2, v1, v2 );
MaxApex = TheSurf->Value( uf1, v2 );
IsV2degen = Standard_True;
}
}
- S = new Geom_RectangularTrimmedSurface( S, u1, u2, v1, v2 );
+ Handle(Geom_BoundedSurface) aSurf = new Geom_RectangularTrimmedSurface( S, u1, u2, v1, v2 );
if (enlargeU)
{
if (enlargeUfirst)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False );
+ GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_False);
if (enlargeUlast)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True );
+ GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_True);
}
if (enlargeV)
{
if (enlargeVfirst)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False );
+ GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_False);
if (enlargeVlast)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True );
+ GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_True);
}
+ S = aSurf;
S->Bounds( U1, U2, V1, V2 );
SurfaceChange = Standard_True;
}
}
}
+ Handle(Geom_BoundedSurface) aSurf = Handle(Geom_BoundedSurface)::DownCast (S);
if (enlargeU)
{
if (enlargeUfirst && uf1-u1 < duf)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_False );
+ GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_False);
if (enlargeUlast && u2-uf2 < duf)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), du, 1, Standard_True, Standard_True );
+ GeomLib::ExtendSurfByLength (aSurf, du, 1, Standard_True, Standard_True);
}
if (enlargeV)
{
if (enlargeVfirst && vf1-v1 < dvf)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_False );
+ GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_False);
if (enlargeVlast && v2-vf2 < dvf)
- GeomLib::ExtendSurfByLength( Handle(Geom_BoundedSurface)::DownCast (S), dv, 1, Standard_False, Standard_True );
+ GeomLib::ExtendSurfByLength (aSurf, dv, 1, Standard_False, Standard_True);
}
+ S = aSurf;
S->Bounds( U1, U2, V1, V2 );
SurfaceChange = Standard_True;
{
cout<<endl<<"Interpolation failed"<<endl;
}
- Handle(Geom_Curve) InterCurve = Interpol.Curve();
+ Handle(Geom_Curve) InterCurve (Interpol.Curve());
MidEdges(i) = BRepLib_MakeEdge(InterCurve);
i = j;
}
#include <gp_Dir2d.hxx>
#include <gp_XY.hxx>
-#include <Geom_UndefinedValue.hxx>
-#include <Geom_UndefinedDerivative.hxx>
-#include <Geom2d_UndefinedValue.hxx>
-#include <Geom2d_UndefinedDerivative.hxx>
-
#include <Standard_NullValue.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
-#include <Standard_CString.hxx>
-#include <Standard_Boolean.hxx>
#include <Draw_Interpretor.hxx>
+#include <Geom_Geometry.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom2d_Curve.hxx>
+
class gp_Pnt;
class gp_Pnt2d;
-class Geom_Geometry;
-class Geom2d_Curve;
class Poly_Triangulation;
class Poly_Polygon3D;
class Poly_Polygon2D;
class Geom_BSplineCurve;
class Geom2d_BezierCurve;
class Geom2d_BSplineCurve;
-class Geom_Surface;
class Geom_BezierSurface;
class Geom_BSplineSurface;
class DrawTrSurf_Drawable;
return;
}
- Standard_Real Ratio;
+ Standard_Real Ratio = 1.;
GCPnts_AbscissaType Type = computeType(C,Ratio);
switch (Type) {
#include <Standard_Type.hxx>
typedef Geom_Conic Conic;
-typedef Handle(Geom_Conic) Handle(Conic);
typedef gp_Ax1 Ax1;
typedef gp_Ax2 Ax2;
typedef gp_Pnt Pnt;
#include <Standard.hxx>
#include <Standard_Type.hxx>
-#include <Geom_Geometry.hxx>
+#include <Geom_Curve.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <GeomAbs_Shape.hxx>
class Geom_UndefinedValue;
class gp_Trsf;
class gp_GTrsf2d;
-class Geom_Curve;
class gp_Pnt;
class gp_Vec;
#include <Standard_Type.hxx>
typedef Geom2d_Conic Conic;
-typedef Handle(Geom2d_Conic) Handle(Conic);
typedef gp_Ax2d Ax2d;
typedef gp_Dir2d Dir2d;
typedef gp_Pnt2d Pnt2d;
typedef gp_Vec2d Vec2d;
-
-
-
-
-
//=======================================================================
//function : SetAxis
//purpose :
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dToIGES_Geom2dCurve.hxx>
#include <Geom2dToIGES_Geom2dEntity.hxx>
+#include <Geom_Curve.hxx>
#include <GeomAPI.hxx>
#include <GeomToIGES_GeomCurve.hxx>
#include <gp.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
-class Geom2d_Curve;
-class Geom_Curve;
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+
class gp_Pln;
class GeomAPI_ProjectPointOnCurve;
class GeomAPI_ProjectPointOnSurf;
{
bound[0] = B1; bound[1] = B2; bound[2] = B3; bound[3] = B4;
Standard_Real deb0, deb1, fin0, fin1;
+
B2->Bounds(deb1,fin1);
- a[0] = new Law_Linear();
- (*((Handle(Law_Linear)*) &a[0]))->Set(deb1,1.,fin1,0.);
+ Handle(Law_Linear) aLaw0 = new Law_Linear();
+ aLaw0->Set (deb1, 1., fin1, 0.);
+ a[0] = aLaw0;
+
B1->Bounds(deb0,fin0);
- a[1] = new Law_Linear();
- (*((Handle(Law_Linear)*) &a[1]))->Set(deb0,0.,fin0,1.);
+ Handle(Law_Linear) aLaw1 = new Law_Linear();
+ aLaw1->Set (deb0, 0., fin0, 1.);
+ a[1] = aLaw1;
gp_XYZ temp;
temp = B4->Value(deb1).XYZ().Added(B1->Value(deb0).XYZ());
// the proximity of point to curve or surface. It is clear that this tolerance
// value can't be too high to be not in conflict with previous rule.
static const Standard_Real MAXTOLERANCEGEOM = 1.e-4;
-static const Standard_Real MAXTOLERANCEPARM = 1.e-3;
-static const Standard_Real UNKNOWNVALUE = 1.e+100;
static const Standard_Real PARTOLERANCE = 1.e-9;
//=======================================================================
//---------------------------------------------------------
Handle(Adaptor3d_HCurve) GeomPlate_CurveConstraint :: Curve3d () const
{ if (my3dCurve.IsNull())
- return myFrontiere;
+ return Handle(Adaptor3d_HCurve) (myFrontiere);
else
return my3dCurve;
}
const Handle(StepGeom_Axis2Placement3d) &
GeomToStep_MakeAxis2Placement3d::Value() const
{
- StdFail_NotDone_Raise_if(!done == Standard_True,"");
+ StdFail_NotDone_Raise_if(!done,"");
return theAxis2Placement3d;
}
if (!strcmp(a[2], "seg")) {
if (DrawTrSurf::GetPoint(a[3], P1)) {
if (DrawTrSurf::GetPoint(a[4], P2)) {
- Handle(Geom_Curve) theline = GC_MakeSegment(P1,P2).Value();
+ Handle(Geom_Curve) theline (GC_MakeSegment(P1,P2).Value());
DrawTrSurf::Set(a[1], theline);
return 1;
}
if (n>6) {
DrawTrSurf::GetPoint(a[6], P4);
gp_Vec V1 = gp_Vec(P2,P3);
- Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,V1,P4).Value();
+ Handle(Geom_Curve)thearc (GC_MakeArcOfCircle(P1,V1,P4).Value());
DrawTrSurf::Set(a[1], thearc);
return 1;
}
else {
- Handle(Geom_Curve)thearc = GC_MakeArcOfCircle(P1,P2,P3).Value();
+ Handle(Geom_Curve)thearc (GC_MakeArcOfCircle(P1,P2,P3).Value());
DrawTrSurf::Set(a[1], thearc);
return 1;
}
Standard_Real Tol = Precision::Confusion();
NbU = Draw::Atoi(a[2]);
- if ( (Handle(Geom_Curve)::
- DownCast(DrawTrSurf::Get(a[3]))).IsNull()) {
+ Handle(Geom_Curve) aCurve (Handle(Geom_Curve)::DownCast(DrawTrSurf::Get(a[3])));
+ if (aCurve.IsNull()) {
// Cas Surfacique
NbV = Draw::Atoi(a[3]);
if (n<4+NbU*NbV) {
#include <Graphic3d_CAspectFillArea.hxx>
#include <Graphic3d_CAspectMarker.hxx>
#include <Graphic3d_CAspectText.hxx>
+#include <Graphic3d_AspectLine3d.hxx>
+#include <Graphic3d_AspectFillArea3d.hxx>
+#include <Graphic3d_AspectText3d.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Real.hxx>
#include <Standard_CString.hxx>
#include <Graphic3d_BoundBuffer.hxx>
#include <Standard_Address.hxx>
#include <Graphic3d_GroupAspect.hxx>
+
+class Graphic3d_Structure;
class Graphic3d_GroupDefinitionError;
class Standard_OutOfRange;
-class Graphic3d_Structure;
-class Graphic3d_AspectLine3d;
-class Graphic3d_AspectFillArea3d;
-class Graphic3d_AspectText3d;
-class Graphic3d_AspectMarker3d;
class TCollection_ExtendedString;
class Graphic3d_ArrayOfPrimitives;
class gp_Ax2;
public:
-
+
//! Supress all primitives and attributes of <me>.
//! To clear group without update in Graphic3d_StructureManager
//! pass Standard_False as <theUpdateStructureMgr>. This
//! already released (pointers are used here to avoid handle
//! cross-reference);
Standard_EXPORT virtual void Clear (const Standard_Boolean theUpdateStructureMgr = Standard_True);
-
+
Standard_EXPORT virtual void UpdateAspectLine (const Standard_Boolean theIsGlobal) = 0;
-
+
Standard_EXPORT virtual void UpdateAspectFace (const Standard_Boolean theIsGlobal) = 0;
-
+
Standard_EXPORT virtual void UpdateAspectMarker (const Standard_Boolean theIsGlobal) = 0;
-
+
Standard_EXPORT virtual void UpdateAspectText (const Standard_Boolean theIsGlobal) = 0;
-
+
//! Supress the group <me> in the structure.
Standard_EXPORT void Destroy();
~Graphic3d_Group()
{
Destroy();
}
-
+
//! Supress the group <me> in the structure.
//! Warning: No more graphic operations in <me> after this call.
//! Modifies the current modelling transform persistence (pan, zoom or rotate)
//! Get the current modelling transform persistence (pan, zoom or rotate)
Standard_EXPORT void Remove();
-
+
//! Modifies the context for all the line primitives
//! of the group.
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
-
+
//! Modifies the context for all the face primitives
//! of the group.
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
-
+
//! Modifies the context for all the text primitives
//! of the group.
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
-
+
//! Modifies the context for all the marker primitives
//! of the group.
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
-
+
//! Modifies the current context of the group to give
//! another aspect for all the line primitives created
//! after this call in the group.
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
-
+
//! Modifies the current context of the group to give
//! another aspect for all the face primitives created
//! after this call in the group.
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
-
+
//! Modifies the current context of the group to give
//! another aspect for all the text primitives created
//! after this call in the group.
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
-
+
//! Modifies the current context of the group to give
//! another aspect for all the marker primitives created
//! after this call in the group.
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
-
+
//! Sets the coordinates of the boundary box of the
//! group <me>.
Standard_EXPORT void SetMinMaxValues (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real ZMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real ZMax);
-
+
//! Creates the string <AText> at position <APoint>.
//! The 3D point of attachment is projected. The text is
//! written in the plane of projection.
//! AAngle : Orientation of the text
//! (with respect to the horizontal).
Standard_EXPORT virtual void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
-
+
//! Creates the string <AText> at position <APoint>.
//! The 3D point of attachment is projected. The text is
//! written in the plane of projection.
//! AHta : HTA_LEFT
//! AVta : VTA_BOTTOM
Standard_EXPORT void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
-
+
//! Creates the string <AText> at position <APoint>.
//! The 3D point of attachment is projected. The text is
//! written in the plane of projection.
//! AAngle : Orientation of the text
//! (with respect to the horizontal).
Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
-
+
//! Creates the string <AText> at position <APoint>.
//! The 3D point of attachment is projected. The text is
//! written in the plane of projection.
//! AHta : HTA_LEFT
//! AVta : VTA_BOTTOM
Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
-
+
//! Adds an array of primitives for display
Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType, const Handle(Graphic3d_IndexBuffer)& theIndices, const Handle(Graphic3d_Buffer)& theAttribs, const Handle(Graphic3d_BoundBuffer)& theBounds, const Standard_Boolean theToEvalMinMax = Standard_True);
-
+
//! Adds an array of primitives for display
Standard_EXPORT void AddPrimitiveArray (const Handle(Graphic3d_ArrayOfPrimitives)& thePrim, const Standard_Boolean theToEvalMinMax = Standard_True);
-
+
//! Creates a primitive array with single marker using AddPrimitiveArray().
Standard_EXPORT void Marker (const Graphic3d_Vertex& thePoint, const Standard_Boolean theToEvalMinMax = Standard_True);
-
+
//! Creates a UserDraw primitive using obsolete API.
Standard_EXPORT virtual void UserDraw (const Standard_Address theObject, const Standard_Boolean theToEvalMinMax = Standard_True, const Standard_Boolean theContainsFacet = Standard_False);
-
+
//! sets the stencil test to theIsEnabled state;
Standard_EXPORT virtual void SetStencilTestOptions (const Standard_Boolean theIsEnabled) = 0;
-
+
//! sets the flipping to theIsEnabled state.
Standard_EXPORT virtual void SetFlippingOptions (const Standard_Boolean theIsEnabled, const gp_Ax2& theRefPlane) = 0;
-
+
//! Returns TRUE if aspect is set for the group.
Standard_EXPORT Standard_Boolean IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const;
-
+
//! Returns the context of all the primitives of the group.
Standard_EXPORT void GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
-
+
//! Returns the last inserted context in the group <me>
//! foreach kind of primitives.
Standard_EXPORT void PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
-
+
//! Returns Standard_True if the group <me> contains
//! Polygons, Triangles or Quadrangles.
Standard_EXPORT Standard_Boolean ContainsFacet() const;
-
+
//! Returns Standard_True if the group <me> is deleted.
//! <me> is deleted after the call Remove (me) or the
//! associated structure is deleted.
Standard_EXPORT Standard_Boolean IsDeleted() const;
-
+
//! Returns Standard_True if the group <me> is empty.
Standard_EXPORT Standard_Boolean IsEmpty() const;
-
+
//! Returns the coordinates of the boundary box of the
//! group <me>.
Standard_EXPORT void MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const;
-
+
//! Returns boundary box of the group <me> without transformation applied,
Standard_EXPORT const Graphic3d_BndBox4f& BoundingBox() const;
-
+
//! Returns non-const boundary box of the group <me> without transformation applied,
Standard_EXPORT Graphic3d_BndBox4f& ChangeBoundingBox();
-
+
//! Returns the structure containing the group <me>.
Standard_EXPORT Handle(Graphic3d_Structure) Structure() const;
-
+
//! Changes property shown that primitive arrays within this group form closed volume (do no contain open shells).
Standard_EXPORT void SetClosed (const Standard_Boolean theIsClosed);
-
+
//! Return true if primitive arrays within this graphic group form closed volume (do no contain open shells).
Standard_EXPORT Standard_Boolean IsClosed() const;
protected:
-
+
//! Creates a group in the structure <AStructure>.
Standard_EXPORT Graphic3d_Group(const Handle(Graphic3d_Structure)& theStructure);
private:
-
+
//! Returns the extreme coordinates found in the group.
Standard_EXPORT void MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const;
-
+
//! Calls the Update method of the StructureManager which
//! contains the associated Structure of the Group <me>.
Standard_EXPORT void Update() const;
myBSDF.Le = Graphic3d_Vec3 (static_cast<Standard_ShortReal> (myDiffuseColor.Red()),
static_cast<Standard_ShortReal> (myDiffuseColor.Green()),
static_cast<Standard_ShortReal> (myDiffuseColor.Blue()));
- myBSDF.Fresnel == Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f));
+ myBSDF.Fresnel = Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f));
break;
case Graphic3d_NOM_METALIZED:
myShininess = Standard_ShortReal (0.13);
myBSDF.Kr = Graphic3d_Vec3 (0.207843f, 0.207843f, 0.207843f);
myBSDF.Le = Graphic3d_Vec3 (0.0f, 1.0f, 0.46f);
- myBSDF.Fresnel == Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f));
+ myBSDF.Fresnel = Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.3f, 0.3f, 0.3f));
break;
case Graphic3d_NOM_OBSIDIAN:
myMaterialType = Graphic3d_MATERIAL_PHYSIC;
(const Standard_Integer Index) const
{ return theEntities->Value(Index); }
- Handle(Standard_Transient) IGESBasic_Group::Value
- (const Standard_Integer Index) const
- { return theEntities->Value(Index); }
+Handle(Standard_Transient) IGESBasic_Group::Value (const Standard_Integer Index) const
+{
+ return Handle(Standard_Transient) (theEntities->Value(Index));
+}
void IGESBasic_Group::SetValue
(const Standard_Integer Index, const Handle(IGESData_IGESEntity)& ent)
return theAssocEntities->Value(Index);
}
- Handle(Standard_Transient) IGESBasic_SubfigureDef::Value
- (const Standard_Integer Index) const
+Handle(Standard_Transient) IGESBasic_SubfigureDef::Value (const Standard_Integer Index) const
{
- return theAssocEntities->Value(Index);
+ return Handle(Standard_Transient) (theAssocEntities->Value(Index));
}
(const Standard_Integer num) const
{
Handle(IGESData_Protocol) res;
- if (num == 1) return theresource;
+ if (num == 1) return Handle(Interface_Protocol) (theresource);
else if (!thenext.IsNull()) return thenext->Resource(num-1);
return res; // Null
}
{
Standard_Integer res = 0;
Standard_Integer nb = ent->NbDisplayedEntities();
- Handle(IGESData_ViewKindEntity) entcomp = ent;
+ Handle(IGESData_ViewKindEntity) entcomp (ent);
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res ++;
// Les entites affichees doivent referencer <ent>. Elles ont priorite.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
- Handle(IGESData_ViewKindEntity) entcomp = ent;
+ Handle(IGESData_ViewKindEntity) entcomp (ent);
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res = Standard_True;
if (ent->LineFontValue(i) != 0 && ent->IsFontDefinition(i)) ach->AddFail
("At least one Line Font Definition Mismatch (both Value and Entity");
}
- Handle(IGESData_ViewKindEntity) entcomp = ent;
+ Handle(IGESData_ViewKindEntity) entcomp (ent);
Standard_Integer res = 0;
nb = ent->NbDisplayedEntities();
for (i = 1; i <= nb; i ++) {
// Les entites affichees doivent referencer <ent>. Elles ont priorite.
Standard_Boolean res = Standard_False;
Standard_Integer nb = ent->NbDisplayedEntities();
- Handle(IGESData_ViewKindEntity) entcomp = ent;
+ Handle(IGESData_ViewKindEntity) entcomp (ent);
for (Standard_Integer i = 1; i <= nb; i ++) {
Handle(IGESData_IGESEntity) displayed = ent->DisplayedEntity(i);
if (entcomp != displayed->View()) res = Standard_True;
Standard_Boolean isFound1 = Standard_False, isFound2 = Standard_False;
Standard_Boolean isForce = Standard_False;
- if((aWLFindStatus[i] == WLFStatus_Absent))
+ if (aWLFindStatus[i] == WLFStatus_Absent)
{
if(((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1-aUSurf1l) < theTol2D))
{
}
}
}
+ }
}
- }
//
return aDMax;
}
case IntPatch_Restriction:
{
- GeomAbs_SurfaceType typS1 = myHS1->Surface().GetType();
- GeomAbs_SurfaceType typS2 = myHS2->Surface().GetType();
- Standard_Boolean isAnalS1 = Standard_False;
- switch (typS1)
- {
- case GeomAbs_Plane:
- case GeomAbs_Cylinder:
- case GeomAbs_Sphere:
- case GeomAbs_Cone:
- case GeomAbs_Torus: isAnalS1 = Standard_True; break;
- default: break;
- }
-
- Standard_Integer isAnalS2 = Standard_False;
- switch (typS2)
- {
- case GeomAbs_Plane:
- case GeomAbs_Cylinder:
- case GeomAbs_Sphere:
- case GeomAbs_Cone:
- case GeomAbs_Torus: isAnalS2 = Standard_True; break;
- default: break;
- }
-
Handle(IntPatch_RLine) RL =
Handle(IntPatch_RLine)::DownCast(L);
Handle(Geom_Curve) aC3d;
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
+class LDOM_MemManager;
class LDOM_NullPtr;
class TCollection_AsciiString;
class TCollection_ExtendedString;
Handle(Standard_Type) styp = S->DynamicType();
if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
- S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface();
+ S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
styp = S->DynamicType();
}
S = BRep_Tool::Surface(Fac, LocFac);
styp = S->DynamicType();
if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
- S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface();
+ S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
styp = S->DynamicType();
}
if (styp == STANDARD_TYPE(Geom_Plane)) {
S = BRep_Tool::Surface(Fac);
styp = S->DynamicType();
if (styp == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
- S = (*((Handle(Geom_RectangularTrimmedSurface)*)&(S)))->BasisSurface();
+ S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
styp = S->DynamicType();
}
#include <Message_ExecStatus.hxx>
#include <TColStd_HArray1OfTransient.hxx>
-#include <Message_HArrayOfMsg.hxx>
#include <MMgt_TShared.hxx>
#include <Message_Status.hxx>
#include <Standard_Integer.hxx>
#include <Standard_CString.hxx>
#include <Standard_Boolean.hxx>
#include <Message_Gravity.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TCollection_HExtendedString.hxx>
#include <TColStd_HSequenceOfHExtendedString.hxx>
#include <TColStd_SequenceOfHExtendedString.hxx>
+#include <Message_HArrayOfMsg.hxx>
+
class Message_Messenger;
class TCollection_AsciiString;
class TCollection_HAsciiString;
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
-#include <TCollection_ExtendedString.hxx>
+#include <TCollection_HAsciiString.hxx>
+#include <TCollection_HExtendedString.hxx>
#include <TColStd_SequenceOfInteger.hxx>
-#include <Standard_CString.hxx>
-#include <Standard_Integer.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
+
class TCollection_ExtendedString;
class TCollection_AsciiString;
class TCollection_HAsciiString;
namespace
{
- //! Convert index data type from size
- inline GLenum toGlIndexType (const Standard_Integer theStride)
- {
- switch (theStride)
- {
- case 2: return GL_UNSIGNED_SHORT;
- case 4: return GL_UNSIGNED_INT;
- default: return GL_NONE;
- }
- }
-
//! Convert data type to GL info
inline GLenum toGlDataType (const Graphic3d_TypeOfData theType,
GLint& theNbComp)
#include <OpenGl_AspectMarker.hxx>
#include <OpenGl_AspectText.hxx>
+#include <OpenGl_GraphicDriver.hxx>
#include <OpenGl_Group.hxx>
#include <OpenGl_Matrix.hxx>
#include <OpenGl_Vec.hxx>
//
}
-//! Convert GL type to Graphic3d enumeration
-static inline bool toGraphic3dDataType (const GLuint theNbComponents,
- const GLenum theGlType,
- Graphic3d_TypeOfData& theType)
-{
- switch (theGlType)
- {
- case GL_UNSIGNED_BYTE:
- {
- if (theNbComponents == 4)
- {
- theType = Graphic3d_TOD_VEC4UB;
- return true;
- }
- return false;
- }
- case GL_UNSIGNED_SHORT:
- {
- if (theNbComponents == 1)
- {
- theType = Graphic3d_TOD_USHORT;
- return true;
- }
- return false;
- }
- case GL_UNSIGNED_INT:
- {
- if (theNbComponents == 1)
- {
- theType = Graphic3d_TOD_UINT;
- return true;
- }
- return false;
- }
- case GL_FLOAT:
- {
- switch (theNbComponents)
- {
- case 2: theType = Graphic3d_TOD_VEC2; return true;
- case 3: theType = Graphic3d_TOD_VEC3; return true;
- case 4: theType = Graphic3d_TOD_VEC4; return true;
- }
- return false;
- }
- }
- return false;
-}
-
// =======================================================================
// function : initLink
// purpose :
namespace
{
- static const Tmatrix3 myDefaultMatrix = { { 1.F, 0.F, 0.F, 0.F }, { 0.F, 1.F, 0.F, 0.F }, { 0.F, 0.F, 1.F, 0.F }, { 0.F, 0.F, 0.F, 1.F } };
static const OPENGL_ZCLIP myDefaultZClip = { { Standard_True, 0.F }, { Standard_True, 1.F } };
-
static const OPENGL_FOG myDefaultFog = { Standard_False, 0.F, 1.F, { { 0.F, 0.F, 0.F, 1.F } } };
static const TEL_TRANSFORM_PERSISTENCE myDefaultTransPers = { 0, 0.F, 0.F, 0.F };
- static const GLdouble THE_IDENTITY_MATRIX[4][4] =
- {
- {1.0, 0.0, 0.0, 0.0},
- {0.0, 1.0, 0.0, 0.0},
- {0.0, 0.0, 1.0, 0.0},
- {0.0, 0.0, 0.0, 1.0}
- };
}
/*----------------------------------------------------------------------*/
myFrontCulling.ChangeEdge() = 0;
}
+// =======================================================================
+// function : SetActiveView
+// purpose :
+// =======================================================================
+void OpenGl_Workspace::SetActiveView (const Handle(OpenGl_View)& theView,
+ const Standard_Integer theViewId)
+{
+ myView = theView;
+ myViewId = theViewId;
+}
+
// =======================================================================
// function : SetImmediateModeDrawToFront
// purpose :
class OpenGl_Structure;
class OpenGl_TriangleSet;
class OpenGl_Element;
+class OpenGl_View;
class Image_PixMap;
//! OpenGL material definition
virtual ~OpenGl_Workspace();
void SetActiveView (const Handle(OpenGl_View)& theView,
- const Standard_Integer theViewId)
- {
- myView = theView;
- myViewId = theViewId;
- }
+ const Standard_Integer theViewId);
const Handle(OpenGl_View)& ActiveView() const { return myView; }
#include <Prs3d_BasicAspect.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Aspect_TypeOfLine.hxx>
-#include <Standard_Real.hxx>
-class Graphic3d_AspectLine3d;
+#include <Graphic3d_AspectLine3d.hxx>
+
class Quantity_Color;
#include <Prs3d_Root.hxx>
#include <Prs3d_Drawer.hxx>
+#include <Prs3d_TextAspect.hxx>
+
class Prs3d_Presentation;
class TCollection_ExtendedString;
class gp_Pnt;
-class Prs3d_TextAspect;
-
//! A framework to define the display of texts.
class Prs3d_Text : public Prs3d_Root
// endPoint,
// origin.Location(),
// Standard_True).Value();
- Handle(Geom_Curve) SpineCurve = GC_MakeArcOfCircle(circle,
- 0.0,
- bend_angle,
- Standard_True).Value();
+ Handle(Geom_Curve) SpineCurve (GC_MakeArcOfCircle (circle, 0.0, bend_angle, Standard_True).Value());
// SUPPORT:
// - Use correct formula for scaling laws
BRepBuilderAPI_MakeFace mkFace;
- Handle(Geom_Curve) SpineCurve = GC_MakeArcOfCircle(circle,
- endPoint,
- origin.Location(),
- Standard_True).Value();
+ Handle(Geom_Curve) SpineCurve (GC_MakeArcOfCircle (circle, endPoint, origin.Location(), Standard_True).Value());
Handle(Law_Linear) myLaw = new Law_Linear();
Handle(Law_Linear) myLaw2 = new Law_Linear();
static Standard_Integer OCC23595 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char** /*argv*/)
{
- const Handle(TDocStd_Application)& anApp = XCAFApp_Application::GetApplication();
+ Handle(TDocStd_Application) anApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) aDoc;
anApp->NewDocument ("XmlXCAF", aDoc);
QCOMPARE (!aDoc.IsNull(), Standard_True);
#include <memory>
#include <typeinfo>
-#if defined(__GNUC__) && __cplusplus < 201103L
-#include <tr1/memory>
-#endif
-
// auxiliary macro to check and report status
#define CHECK(di,ok,what) di << "Checking " << what << (ok ? ": OK\n" : ": Error\n")
}
Handle(Standard_Transient) aHandle = new Standard_Transient();
- std::tr1::shared_ptr<Standard_Transient> aSharePtr (new Standard_Transient());
+ std::shared_ptr<Standard_Transient> aSharePtr (new Standard_Transient());
theDI << "Time of creating and destroying " << aNbIters << " smart pointers to the same object, per item, ns:";
{
{
{
QATimer aTimer (theDI, "\nsC++ shared_ptr: ", QATimer::ns, aNbIters);
{
- std::vector< std::tr1::shared_ptr<Standard_Transient> > aSharePointers (aNbIters);
+ std::vector< std::shared_ptr<Standard_Transient> > aSharePointers (aNbIters);
for (Standard_Integer anIter = 0; anIter < aNbIters; ++anIter)
{
aSharePointers[anIter] = aSharePtr;
template<typename TFrom>
static void doShareCast (Draw_Interpretor& theDI,
const Standard_Integer theNbIters,
- const std::tr1::shared_ptr<TFrom>& theSharePtr)
+ const std::shared_ptr<TFrom>& theSharePtr)
{
- std::vector< std::tr1::shared_ptr<typename TTo::element_type> > aSharePointers (theNbIters);
+ std::vector< std::shared_ptr<typename TTo::element_type> > aSharePointers (theNbIters);
{
QATimer aTimer (theDI, " ", QATimer::ns, theNbIters);
for (Standard_Integer anIter = 0; anIter < theNbIters; ++anIter)
{
- aSharePointers[anIter] = std::tr1::dynamic_pointer_cast<typename TTo::element_type, TFrom> (theSharePtr);
+ aSharePointers[anIter] = std::dynamic_pointer_cast<typename TTo::element_type, TFrom> (theSharePtr);
}
}
}
}
theDI << "\nC++ dynamic_pointer_cast: ";
{
- std::tr1::shared_ptr<typename TAs::element_type> aPtr ((typename TAs::element_type* )theInst.Clone());
+ std::shared_ptr<typename TAs::element_type> aPtr ((typename TAs::element_type* )theInst.Clone());
QA_TEST_CAST10(0, doShareCast);
QA_TEST_CAST10(1, doShareCast);
QA_TEST_CAST10(2, doShareCast);
typename CollectionType::const_iterator::value_type ct = *cit;
ct = *cit;
+ (void)ct;
// *cit2 = ct;
// *(cit2.operator-> ()) = t;
Handle(Standard_Transient) STEPConstruct_Assembly::ItemValue () const
{
- if (theval.IsNull()) return thesr;
+ if (theval.IsNull()) return Handle(Standard_Transient) (thesr);
return theval;
}
#include <STEPConstruct_Part.hxx>
#include <StepData_StepModel.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
+#include <StepRepr_NextAssemblyUsageOccurrence.hxx>
#include <StepRepr_PropertyDefinition.hxx>
#include <StepShape_ShapeDefinitionRepresentation.hxx>
#include <TCollection_HAsciiString.hxx>
#ifndef _Standard_HeaderFile
#define _Standard_HeaderFile
-#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
#include <Standard_Address.hxx>
#include <Standard_Size.hxx>
#include <Standard_Integer.hxx>
//! Deallocates memory blocks
//! @param thePtr - previously allocated memory block to be freed
Standard_EXPORT static void Free (const Standard_Address thePtr);
-
+
//! Template version of function Free(), nullifies the argument pointer
//! @param thePtr - previously allocated memory block to be freed
template <typename T>
//! Deallocates memory blocks
//! @param thePtrAligned the memory block previously allocated with AllocateAligned()
Standard_EXPORT static void FreeAligned (const Standard_Address thePtrAligned);
-
+
//! Template version of function FreeAligned(), nullifies the argument pointer
//! @param thePtrAligned the memory block previously allocated with AllocateAligned()
template <typename T>
//==================================================
Standard_Boolean StdSelect_EdgeFilter::IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
{
- if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False;
-
- const TopoDS_Shape& sh = Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
+ Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO));
+ if (aBO.IsNull())
+ return Standard_False;
+
+ const TopoDS_Shape& sh = aBO->Shape();
if(sh.ShapeType()!= TopAbs_EDGE) return Standard_False;
switch(mytype){
Standard_Boolean StdSelect_FaceFilter::
IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
{
- if (Handle(StdSelect_BRepOwner)::DownCast(EO).IsNull()) return Standard_False;
- const TopoDS_Shape& anobj= Handle(StdSelect_BRepOwner)::DownCast (EO)->Shape();
- if(anobj.ShapeType()!= TopAbs_FACE)return Standard_False;
+ Handle(StdSelect_BRepOwner) aBO (Handle(StdSelect_BRepOwner)::DownCast(EO));
+ if (aBO.IsNull())
+ return Standard_False;
+
+ const TopoDS_Shape& anobj = aBO->Shape();
+ if(anobj.ShapeType()!= TopAbs_FACE)
+ return Standard_False;
+
switch(mytype) {
case StdSelect_AnyFace:
return Standard_True;
const Handle(StepShape_Edge)& StepEdge,
const Handle(StepShape_EdgeLoop)& EdgeLoop)
{
- if (!Handle(StepGeom_SeamCurve)::DownCast(SurfCurve).IsNull())
+ if (SurfCurve->IsKind(STANDARD_TYPE(StepGeom_SeamCurve)))
return Standard_True;
if (SurfCurve->NbAssociatedGeometry() != 2) return Standard_False;
void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane)
{
// OCC2932 correction
- Handle(TNaming_NamedShape) aPlane =
- Handle(TNaming_NamedShape)::DownCast(myPlane);
- if (aPlane.IsNull() == Standard_False && plane.IsNull() == Standard_False)
- if ( aPlane -> Get() == plane->Get())
+ if (! myPlane.IsNull() && ! plane.IsNull() && myPlane->Get() == plane->Get())
return;
Backup();
//=======================================================================
const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const
{
- return Handle(TNaming_NamedShape)::DownCast (myPlane);
+ return myPlane;
}
//=======================================================================
#include <Standard_Integer.hxx>
#include <TDF_LabelList.hxx>
#include <Standard_OStream.hxx>
+
class TDataStd_Real;
class TDF_Attribute;
class Standard_GUID;
TDataXtd_ConstraintEnum myType;
Handle(TDataStd_Real) myValue;
Handle(TDF_Attribute) myGeometries[4];
- Handle(TDF_Attribute) myPlane;
+ Handle(TNaming_NamedShape) myPlane;
Standard_Boolean myIsReversed;
Standard_Boolean myIsInverted;
Standard_Boolean myIsVerified;
-
-
};
-
-
-
-
-
-
#endif // _TDataXtd_Constraint_HeaderFile
else
anOS << "There are " << myDocuments.Length() << " documents ( ";
for(i = 1; i <= myDocuments.Length(); i++) {
- Handle(Standard_Transient) aDoc = myDocuments.Value(i);
+ Handle(Standard_Transient) aDoc (myDocuments.Value(i));
anOS << "\"" << aDoc.get();
anOS << "\" ";
}
that->myColorScaleLayerItem = new V3d_ColorScaleLayerItem( that->myColorScale );
}
- return myColorScale;
+ return Handle(Aspect_ColorScale) (myColorScale);
}
Standard_Boolean V3d_LayerMgr::Begin()
{
switch (myGridType)
{
- case Aspect_GT_Circular: return myCGrid;
- case Aspect_GT_Rectangular: return myRGrid;
+ case Aspect_GT_Circular: return Handle(Aspect_Grid) (myCGrid);
+ case Aspect_GT_Rectangular: return Handle(Aspect_Grid) (myRGrid);
}
- return myRGrid;
+ return Handle(Aspect_Grid) (myRGrid);
}
// =======================================================================
}
case BndAction_Show:
{
- Handle(Graphic3d_Structure) aPrs = thePrs->Presentation();
+ Handle(Graphic3d_Structure) aPrs (thePrs->Presentation());
aPrs->CStructure()->HighlightColor.r = 0.988235f;
aPrs->CStructure()->HighlightColor.g = 0.988235f;
aPrs->CStructure()->HighlightColor.b = 0.988235f;
{
const TCollection_AsciiString& aName = aNamesOfIO.Value (anIter);
- const Handle(AIS_InteractiveObject)& aShape = GetMapOfAIS().IsBound2 (aName) ?
- Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aName)) : GetAISShapeFromName (aName.ToCString());
+ Handle(AIS_InteractiveObject) aShape;
+ if (GetMapOfAIS().IsBound2 (aName))
+ aShape = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aName));
+ else
+ aShape = GetAISShapeFromName (aName.ToCString());
if (!aShape.IsNull())
{
{
// Declarations
Standard_Integer aCurrentIndex;
- Standard_Real aRadius;
// Verification
if (argc != 2)
return 1;
}
- gp_Circ aCircle = aCurve.Circle();
- aRadius = 2.0 * aCircle.Radius();
-
// Construction of the diameter dimension.
TheAISContext()->CloseLocalContext (aCurrentIndex);
Handle (AIS_DiameterDimension) aDiamDim= new AIS_DiameterDimension (aShape);
{
// Declarations
Standard_Integer aCurrentIndex;
- Standard_Real aRadius;
TopoDS_Edge anEdge;
// Verification
if (argc != 2)
di << argv[0] << " error: the edge is not a circular one." << "\n";
return 1;
}
- else
- {
- gp_Circ aCircle = aCurve.Circle();
- aRadius = aCircle.Radius();
- aRadius = Round (aRadius * 10.0) / 10.0;
- }
// Close the context
TheAISContext()->CloseLocalContext (aCurrentIndex);
Handle(AIS_InteractiveObject) aPickedObj;
gp_Pnt aPoint (gp::Origin());
- Standard_Integer aCurrentIndex = 0;
Standard_Integer aMaxPickNum = 5;
// Find object
// Open local context and get its index for recovery.
TheAISContext()->OpenLocalContext();
- aCurrentIndex = TheAISContext()->IndexOfCurrentLocal();
// Loop that will be handle picking.
Standard_Integer anArgNum = 5;
new VrmlData_Normal (myScene, 0L, nNodes, arrVec);
myScene.AddNode (aNormalNode, Standard_False);
aFaceSet->SetNormals (aNormalNode);
- return aFaceSet;
+ return Handle(VrmlData_Geometry) (aFaceSet);
}
Poly_Connect PC(theTri);
}
}
- return aFaceSet;
+ return Handle(VrmlData_Geometry) (aFaceSet);
}
//=======================================================================
myScene.AddNode (aCoordNode, Standard_False);
aLineSet->SetCoordinates (aCoordNode);
- return aLineSet;
+ return Handle(VrmlData_Geometry) (aLineSet);
}
//=======================================================================
Handle(Transfer_Binder) bnd = FP->MapItem ( i );
if(!bnd.IsNull())
aSeqBnd.Append(bnd);
- Handle(Standard_Transient) ash = FP->Mapped(i);
+ Handle(Standard_Transient) ash (FP->Mapped(i));
aSeqShapes.Append(ash);
}
//removing finder process containing result of translation.