diff --git a/src/Graphic3d/Graphic3d_CGraduatedTrihedron.hxx b/src/Graphic3d/Graphic3d_CGraduatedTrihedron.hxx index 81e5e5eddb..cea72b447b 100644 --- a/src/Graphic3d/Graphic3d_CGraduatedTrihedron.hxx +++ b/src/Graphic3d/Graphic3d_CGraduatedTrihedron.hxx @@ -24,10 +24,13 @@ #include <TCollection_ExtendedString.hxx> #include <Font_FontAspect.hxx> -typedef void (*minMaxValuesCallback)(void*); +class Visual3d_View; + class Graphic3d_CGraduatedTrihedron { - public: +public: + typedef void (*minMaxValuesCallback)(Visual3d_View*); +public: /* Default constructor. Nullifies the view pointer */ Graphic3d_CGraduatedTrihedron () : xdrawname ( Standard_False ), ydrawname ( Standard_False ), @@ -95,7 +98,7 @@ class Graphic3d_CGraduatedTrihedron /* Callback function to define boundary box of displayed objects */ minMaxValuesCallback cbCubicAxes; - void* ptrVisual3dView; + Visual3d_View* ptrVisual3dView; }; const Handle(Standard_Type)& TYPE(Graphic3d_CGraduatedTrihedron); diff --git a/src/IntPatch/IntPatch_Point.cxx b/src/IntPatch/IntPatch_Point.cxx index d309025e67..00750ba165 100644 --- a/src/IntPatch/IntPatch_Point.cxx +++ b/src/IntPatch/IntPatch_Point.cxx @@ -148,61 +148,26 @@ void IntPatch_Point::Dump() const { cout<<"----------- IntPatch_Point : "<<endl; Standard_Real u1,v1,u2,v2; pt.Parameters(u1,v1,u2,v2); -#if 0 - cout<<"IntSurf_PntOn2S : Pnt ("<<pt.Value().X() - <<","<<pt.Value().Y()<<","<<pt.Value().Z()<<")"<<endl; - cout<<" u1:"<<u1; cout<<" u2:"<<u2; - cout<<" v1:"<<v1; - cout<<" v2:"<<v2<<endl; - cout<<" para("<<para<<")"; - cout<<" mult("<<mult<<")"; - cout<<" OnS1("<<onS1<<")"; - cout<<" VtxOnS1("<<vtxonS1<<")"<<endl; - cout<<" OnS2("<<onS2<<")"; - cout<<" VtxOnS2("<<vtxonS2<<")"; - cout<<" prm1("<<prm1<<")"; - cout<<" prm2("<<prm2<<")"; -#else -#ifndef DEB // for porting on linux printf("P(%15.10f,%15.10f,%15.10f) UV1(%15.10f,%15.10f) UV2(%15.10f,%15.10f) (Para:%15.10f)\n", (double)(pt.Value().X()), (double)(pt.Value().Y()), (double)(pt.Value().Z()), (double)u1,(double)v1,(double)u2,(double)v2,(double)para); - if(onS1) { printf("*OnS1* par=%15.10f arc1=%10lu",(double)prm1, - *((long unsigned *)(((Handle_Standard_Transient *)(&arcS1)))) - ); } - if(vtxonS1) { printf(" *Vtx1* vtx1=%10lu", - *((long unsigned *)(((Handle_Standard_Transient *)(&vS1))))); } + if(onS1) + printf("*OnS1* par=%15.10f arc1=%10p", (double)prm1, (void*)arcS1.operator->()); + if(vtxonS1) + printf(" *Vtx1* vtx1=%10p", (void*)vS1.operator->()); if(onS1 || vtxonS1) printf("\n"); - if(onS2) { printf("*OnS2* par=%15.10f arc2=%10lu",(double)prm2, - *((long unsigned *)(((Handle_Standard_Transient *)(&arcS2))))); } - if(vtxonS2) { printf(" *Vtx2* vtx2=%10lu", - *((long unsigned *)(((Handle_Standard_Transient *)(&vS2))))); } - -#else // debug mode - printf("P(%15.10lf,%15.10lf,%15.10lf) UV1(%15.10lf,%15.10lf) UV2(%15.10lf,%15.10lf) (Para:%15.10lf)\n", - (double)(pt.Value().X()), - (double)(pt.Value().Y()), - (double)(pt.Value().Z()), - (double)u1,(double)v1,(double)u2,(double)v2,(double)para); - if(onS1) { printf("*OnS1* par=%15.10lf arc1=%10lu",(double)prm1, - *((long unsigned *)(((Handle_Standard_Transient *)(&arcS1)))) - ); } - if(vtxonS1) { printf(" *Vtx1* vtx1=%10lu", - *((long unsigned *)(((Handle_Standard_Transient *)(&vS1))))); } - if(onS1 || vtxonS1) printf("\n"); - if(onS2) { printf("*OnS2* par=%15.10lf arc2=%10lu",(double)prm2, - *((long unsigned *)(((Handle_Standard_Transient *)(&arcS2))))); } - if(vtxonS2) { printf(" *Vtx2* vtx2=%10lu", - *((long unsigned *)(((Handle_Standard_Transient *)(&vS2))))); } - -#endif - if(onS2 || vtxonS2) printf("\n"); + if(onS2) + printf("*OnS2* par=%15.10f arc2=%10p", (double)prm2, (void*)arcS2.operator->()); + if(vtxonS2) + printf(" *Vtx2* vtx2=%10lu", (void*)vS2.operator->()); + + if(onS2 || vtxonS2) + printf("\n"); fflush(stdout); - -#endif + if(onS1 || onS2) { cout<<" tgt:"<<((tgt)? 1 : 0) <<" mult:"<<((mult)? 1 :0); if(onS1) { diff --git a/src/NCollection/NCollection_DataMap.hxx b/src/NCollection/NCollection_DataMap.hxx index b678186a15..b3218e7dbb 100644 --- a/src/NCollection/NCollection_DataMap.hxx +++ b/src/NCollection/NCollection_DataMap.hxx @@ -173,13 +173,10 @@ template < class TheKeyType, //! ReSize void ReSize (const Standard_Integer N) { - DataMapNode** newdata = NULL; - DataMapNode** dummy = NULL; + NCollection_ListNode** newdata = NULL; + NCollection_ListNode** dummy = NULL; Standard_Integer newBuck; - if (BeginResize (N, newBuck, - (NCollection_ListNode**&)newdata, - (NCollection_ListNode**&)dummy, - this->myAllocator)) + if (BeginResize (N, newBuck, newdata, dummy, this->myAllocator)) { if (myData1) { @@ -202,10 +199,7 @@ template < class TheKeyType, } } } - EndResize(N,newBuck, - (NCollection_ListNode**&)newdata, - (NCollection_ListNode**&)dummy, - this->myAllocator); + EndResize (N, newBuck, newdata, dummy, this->myAllocator); } } diff --git a/src/NCollection/NCollection_DoubleMap.hxx b/src/NCollection/NCollection_DoubleMap.hxx index 372f17376b..47df450388 100644 --- a/src/NCollection/NCollection_DoubleMap.hxx +++ b/src/NCollection/NCollection_DoubleMap.hxx @@ -193,13 +193,10 @@ template < class TheKey1Type, //! ReSize void ReSize (const Standard_Integer N) { - DoubleMapNode** ppNewData1 = NULL; - DoubleMapNode** ppNewData2 = NULL; + NCollection_ListNode** ppNewData1 = NULL; + NCollection_ListNode** ppNewData2 = NULL; Standard_Integer newBuck; - if (BeginResize (N, newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator)) + if (BeginResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator)) { if (myData1) { @@ -216,7 +213,7 @@ template < class TheKey1Type, iK2 = Hasher2::HashCode (p->Key2(), newBuck); q = (DoubleMapNode*) p->Next(); p->Next() = ppNewData1[iK1]; - p->Next2() = ppNewData2[iK2]; + p->Next2() = (DoubleMapNode*)ppNewData2[iK2]; ppNewData1[iK1] = p; ppNewData2[iK2] = p; p = q; @@ -224,10 +221,7 @@ template < class TheKey1Type, } } } - EndResize(N,newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator); + EndResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator); } } diff --git a/src/NCollection/NCollection_IndexedDataMap.hxx b/src/NCollection/NCollection_IndexedDataMap.hxx index bf93c9d51f..d4ed417300 100644 --- a/src/NCollection/NCollection_IndexedDataMap.hxx +++ b/src/NCollection/NCollection_IndexedDataMap.hxx @@ -197,13 +197,10 @@ template < class TheKeyType, //! ReSize void ReSize (const Standard_Integer N) { - IndexedDataMapNode** ppNewData1 = NULL; - IndexedDataMapNode** ppNewData2 = NULL; + NCollection_ListNode** ppNewData1 = NULL; + NCollection_ListNode** ppNewData2 = NULL; Standard_Integer newBuck; - if (BeginResize (N, newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator)) + if (BeginResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator)) { if (myData1) { @@ -220,7 +217,7 @@ template < class TheKeyType, iK2 = ::HashCode (p->Key2(), newBuck); q = (IndexedDataMapNode*) p->Next(); p->Next() = ppNewData1[iK1]; - p->Next2() = ppNewData2[iK2]; + p->Next2() = (IndexedDataMapNode*)ppNewData2[iK2]; ppNewData1[iK1] = p; ppNewData2[iK2] = p; p = q; @@ -228,10 +225,7 @@ template < class TheKeyType, } } } - EndResize(N,newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator); + EndResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator); } } diff --git a/src/NCollection/NCollection_IndexedMap.hxx b/src/NCollection/NCollection_IndexedMap.hxx index 374c2e464a..c510abc692 100644 --- a/src/NCollection/NCollection_IndexedMap.hxx +++ b/src/NCollection/NCollection_IndexedMap.hxx @@ -187,13 +187,10 @@ template < class TheKeyType, //! ReSize void ReSize (const Standard_Integer N) { - IndexedMapNode** ppNewData1 = NULL; - IndexedMapNode** ppNewData2 = NULL; + NCollection_ListNode** ppNewData1 = NULL; + NCollection_ListNode** ppNewData2 = NULL; Standard_Integer newBuck; - if (BeginResize (N, newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator)) + if (BeginResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator)) { if (myData1) { @@ -213,7 +210,7 @@ template < class TheKeyType, if (p->Key2() > 0) { iK2 = ::HashCode (p->Key2(), newBuck); - p->Next2() = ppNewData2[iK2]; + p->Next2() = (IndexedMapNode*)ppNewData2[iK2]; ppNewData2[iK2] = p; } p = q; @@ -221,10 +218,7 @@ template < class TheKeyType, } } } - EndResize(N,newBuck, - (NCollection_ListNode**&)ppNewData1, - (NCollection_ListNode**&)ppNewData2, - this->myAllocator); + EndResize (N, newBuck, ppNewData1, ppNewData2, this->myAllocator); } } diff --git a/src/NCollection/NCollection_Map.hxx b/src/NCollection/NCollection_Map.hxx index ff762f8fc5..c672032e56 100644 --- a/src/NCollection/NCollection_Map.hxx +++ b/src/NCollection/NCollection_Map.hxx @@ -177,13 +177,10 @@ template < class TheKeyType, //! ReSize void ReSize (const Standard_Integer N) { - MapNode** newdata = 0L; - MapNode** dummy = 0L; + NCollection_ListNode** newdata = 0L; + NCollection_ListNode** dummy = 0L; Standard_Integer newBuck; - if (BeginResize (N, newBuck, - (NCollection_ListNode**&)newdata, - (NCollection_ListNode**&)dummy, - this->myAllocator)) + if (BeginResize (N, newBuck, newdata, dummy, this->myAllocator)) { if (myData1) { @@ -206,10 +203,7 @@ template < class TheKeyType, } } } - EndResize(N,newBuck, - (NCollection_ListNode**&)newdata, - (NCollection_ListNode**&)dummy, - this->myAllocator); + EndResize (N, newBuck, newdata, dummy, this->myAllocator); } } diff --git a/src/OpenGl/OpenGl_GraduatedTrihedron.hxx b/src/OpenGl/OpenGl_GraduatedTrihedron.hxx index ccb226e4c3..610ff0e4d8 100755 --- a/src/OpenGl/OpenGl_GraduatedTrihedron.hxx +++ b/src/OpenGl/OpenGl_GraduatedTrihedron.hxx @@ -21,6 +21,7 @@ #include <OpenGl_Text.hxx> #include <Graphic3d_CGraduatedTrihedron.hxx> +class Visual3d_View; class OpenGl_View; class OpenGl_GraduatedTrihedron : public OpenGl_Element @@ -73,8 +74,8 @@ protected: TEL_COLOUR myXColor; TEL_COLOUR myYColor; TEL_COLOUR myZColor; - minMaxValuesCallback myCbCubicAxes; - void* myPtrVisual3dView; + Graphic3d_CGraduatedTrihedron::minMaxValuesCallback myCbCubicAxes; + Visual3d_View* myPtrVisual3dView; public: diff --git a/src/Visual3d/Visual3d_View.cxx b/src/Visual3d/Visual3d_View.cxx index ab03d7820a..6872ba69d7 100644 --- a/src/Visual3d/Visual3d_View.cxx +++ b/src/Visual3d/Visual3d_View.cxx @@ -3021,22 +3021,20 @@ void Visual3d_View::TriedronEcho (const Aspect_TypeOfTriedronEcho AType ) { } -Standard_Boolean checkFloat(const Standard_Real value) +static Standard_Boolean checkFloat(const Standard_Real value) { return value > -FLT_MAX && value < FLT_MAX; } -void SetMinMaxValuesCallback(void* Visual3dView) +static void SetMinMaxValuesCallback(Visual3d_View* theView) { Standard_Real xmin, ymin, zmin, xmax, ymax, zmax; - - Handle(Visual3d_View) view = (Handle(Visual3d_View)&) Visual3dView; - view->MinMaxValues(xmin, ymin, zmin, xmax, ymax, zmax); + theView->MinMaxValues(xmin, ymin, zmin, xmax, ymax, zmax); if (checkFloat(xmin) && checkFloat(ymin) && checkFloat(zmin) && checkFloat(xmax) && checkFloat(ymax) && checkFloat(zmax)) { - Handle(Graphic3d_GraphicDriver) driver = Handle(Graphic3d_GraphicDriver)::DownCast(view->GraphicDriver()); + Handle(Graphic3d_GraphicDriver) driver = Handle(Graphic3d_GraphicDriver)::DownCast(theView->GraphicDriver()); driver->GraduatedTrihedronMinMaxValues((Standard_ShortReal)xmin, (Standard_ShortReal)ymin, (Standard_ShortReal)zmin, (Standard_ShortReal)xmax, (Standard_ShortReal)ymax, (Standard_ShortReal)zmax); } diff --git a/src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx b/src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx index 0628bc5152..0f1d3845f5 100644 --- a/src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx +++ b/src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx @@ -344,8 +344,7 @@ void XmlMNaming_NamedShapeDriver::ReadShapeSection aNode = anElement.getNextSibling()) { if (aNode.getNodeType() == LDOM_Node::TEXT_NODE) { - LDOM_Text aText = (LDOM_Text&) aNode; - LDOMString aData = aText.getData(); + LDOMString aData = aNode.getNodeValue(); #ifdef USE_STL_STREAM std::stringstream aStream (std::string(aData.GetString())); #else