1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024355: Compiler Warning level 4 for MFC samples

Some warnings were removed from MFC samples
All warnings of sample projects with warning level 4 were fixed on VC9
Warnings level increased to -W4 in projects of MFC samples; sample ReadMe files added to documentation
Changes in Viewer2dDoc.cpp and OcafDoc.cpp were restored.
Minor corrections in documentation
This commit is contained in:
ibs
2013-11-21 13:44:27 +04:00
committed by bugmaster
parent 95eef64da2
commit 5c573e69d3
102 changed files with 2896 additions and 2893 deletions

View File

@@ -99,12 +99,12 @@ void GeomSources::PostProcess(CGeometryDoc* aDoc,
aDoc->SetTitle(Title);
}
void GeomSources::AddSeparator(CGeometryDoc* aDoc,TCollection_AsciiString& aMessage)
void GeomSources::AddSeparator(CGeometryDoc* /*aDoc*/,TCollection_AsciiString& aMessage)
{
aMessage+= "------------------------------------------------------------------------\n";
}
void GeomSources::DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt2d& aPoint,
const gp_Pnt2d& aPoint,
const char* aText,
Standard_Boolean UpdateViewer,
Standard_Real anXoffset,
@@ -119,7 +119,7 @@ void GeomSources::DisplayPoint(CGeometryDoc* aDoc,
}
void GeomSources::DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt& aPoint,
const gp_Pnt& aPoint,
const char* aText,
Standard_Boolean UpdateViewer,
Standard_Real anXoffset,
@@ -224,9 +224,10 @@ Standard_Real result = A.DotCross(B,C); \n\
\n");
AddSeparator(aDoc,Message);
//--------------------------------------------------------------
DisplayPoint(aDoc,gp_Pnt(A),"A (1,2,3)",false,0.1);
DisplayPoint(aDoc,gp_Pnt(B),"B (2,2,2)",false,0.1);
DisplayPoint(aDoc,gp_Pnt(C),"C (3,2,3)", false,0.1);
DisplayPoint(aDoc,gp_Pnt(C),"C (3,2,3)",false,0.1);
// to add a numeric value in a TCollectionAsciiString
TCollection_AsciiString Message2 (result);
@@ -709,7 +710,7 @@ void GeomSources::gpTest10(CGeometryDoc* aDoc)
for(;count<=N;count++)
{
C->D0(UA.Parameter(count),P);
Standard_Real Parameter = UA.Parameter(count);
//Standard_Real Parameter = UA.Parameter(count);
// append P in a Sequence
aSequence.Append(P);
}
@@ -1308,10 +1309,10 @@ gp_Dir A2YDirection = A2.YDirection() ; \n\
aDoc->GetAISContext()->Display(aDirection, Standard_False);
Handle(ISession_Direction) aDirection2 = new ISession_Direction(P1,AXDirection,2);
aDirection2->SetText(TCollection_ExtendedString("A.XDirection"));
aDirection2->SetText("A.XDirection");
aDoc->GetAISContext()->Display(aDirection2, Standard_False);
Handle(ISession_Direction) aDirection3 = new ISession_Direction(P1,AYDirection,2);
aDirection3->SetText(TCollection_ExtendedString("A.YDirection"));
aDirection3->SetText("A.YDirection");
aDoc->GetAISContext()->Display(aDirection3, Standard_False);
DisplayPoint(aDoc,P2,"P2",false,0.1);
@@ -1319,10 +1320,10 @@ gp_Dir A2YDirection = A2.YDirection() ; \n\
aDoc->GetAISContext()->Display(aDirection4, Standard_False);
Handle(ISession_Direction) aDirection5 = new ISession_Direction(P2,A2XDirection,2);
aDirection5->SetText(TCollection_ExtendedString("A2 XDirection"));
aDirection5->SetText("A2 XDirection");
aDoc->GetAISContext()->Display(aDirection5, Standard_False);
Handle(ISession_Direction) aDirection6 = new ISession_Direction(P2,A2YDirection,2);
aDirection6->SetText(TCollection_ExtendedString("A2 YDirection"));
aDirection6->SetText("A2 YDirection");
aDoc->GetAISContext()->Display(aDirection6, Standard_False);
Message += "IsDirectA = ";
@@ -1703,19 +1704,13 @@ gp_Ax2d C2DCircleXAxis = C2DCircle->XAxis(); \n\
DisplayCurve(aDoc,C3D,false);
DisplayCurve(aDoc,C2D,5,false);
Handle(ISession_Direction) aC3DCircleXAxisDirection = new ISession_Direction((gp_Pnt)C3DCircleXAxis.Location(),
(gp_Dir)C3DCircleXAxis.Direction(),
5.2);
Handle(ISession_Direction) aC3DCircleXAxisDirection = new ISession_Direction(C3DCircleXAxis.Location(),C3DCircleXAxis.Direction(),5.2);
aDoc->GetAISContext()->Display(aC3DCircleXAxisDirection, Standard_False);
Handle(ISession_Direction) acirc2dXAxisDirection = new ISession_Direction((gp_Pnt2d)circ2dXAxis.Location(),
(gp_Dir2d)circ2dXAxis.Direction(),
5.2);
Handle(ISession_Direction) acirc2dXAxisDirection = new ISession_Direction(circ2dXAxis.Location(),circ2dXAxis.Direction(),5.2);
aDoc->GetISessionContext()->Display(acirc2dXAxisDirection, Standard_False);
Handle(ISession_Direction) aC2DCircleXAxisDirection = new ISession_Direction((gp_Pnt2d)C2DCircleXAxis.Location(),
(gp_Dir2d)C2DCircleXAxis.Direction(),
5.2);
Handle(ISession_Direction) aC2DCircleXAxisDirection = new ISession_Direction(C2DCircleXAxis.Location(),C2DCircleXAxis.Direction(),5.2);
aDoc->GetISessionContext()->Display(aC2DCircleXAxisDirection, Standard_False);
PostProcess(aDoc,ID_BUTTON_Test_24,TheDisplayType,Message.ToCString());
@@ -2149,7 +2144,7 @@ void GeomSources::gpTest30(CGeometryDoc* aDoc)
gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3);
GccEnt_QualifiedCirc QC = GccEnt::Outside(C);
GccAna_Lin2d2Tan LT (QC,P4,Precision::Confusion());
Standard_Integer NbSol;
Standard_Integer NbSol = 0;
if (LT.IsDone())
{
NbSol = LT.NbSolutions();
@@ -2601,8 +2596,8 @@ void GeomSources::gpTest35(CGeometryDoc* aDoc)
GeomAPI_IntCS CS (aCurve,aSurface);
Handle(Geom_Curve) segment;
Standard_Integer NbSeg;
Standard_Integer NbPoints;
Standard_Integer NbSeg = 0;
Standard_Integer NbPoints = 0;
if(CS.IsDone())
{
NbSeg = CS.NbSegments();
@@ -3782,7 +3777,7 @@ void GeomSources::gpTest47(CGeometryDoc* aDoc)
GeomAPI_PointsToBSplineSurface(array3).Surface();
GeomAPI_ExtremaSurfaceSurface ESS(aSurf1,aSurf2);
Quantity_Length dist = ESS.LowerDistance();
//Quantity_Length dist = ESS.LowerDistance();
gp_Pnt P1,P2;
ESS.NearestPoints(P1,P2);
@@ -3952,10 +3947,10 @@ aSPL2Box.Get( aSPL2Xmin, aSPL2Ymin, aSPL2Xmax,aSPL2Ymax); \n\
DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),gp_Pnt2d(aSPL1Xmin,aSPL1Ymax)) ,4); // Xmin,Y
DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL1Xmax,aSPL1Ymin),gp_Pnt2d(aSPL1Xmax,aSPL1Ymax)) ,4); // Xmax,Y
DisplayPoint(aDoc,gp_Pnt2d(aSPL2Xmin,aSPL2Ymax),Standard_CString("aSPL2Xmin,aSPL2Ymax"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL2Xmax,aSPL2Ymax),Standard_CString("aSPL2Xmax,aSPL2Ymax"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL2Xmin,aSPL2Ymin),Standard_CString("aSPL2Xmin,aSPL2Ymin"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL2Xmax,aSPL2Ymin),Standard_CString("aSPL2Xmax,aSPL2Ymin"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymax),Standard_CString("aSPL2Xmin,aSPL2Ymax"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymax),Standard_CString("aSPL2Xmax,aSPL2Ymax"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmin,aSPL1Ymin),Standard_CString("aSPL2Xmin,aSPL2Ymin"));
DisplayPoint(aDoc,gp_Pnt2d(aSPL1Xmax,aSPL1Ymin),Standard_CString("aSPL2Xmax,aSPL2Ymin"));
DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmin,aSPL2Ymax),gp_Pnt2d(aSPL2Xmax,aSPL2Ymax)) ,4); // X,Ymax
DisplayCurve(aDoc,GCE2d_MakeSegment(gp_Pnt2d(aSPL2Xmin,aSPL2Ymin),gp_Pnt2d(aSPL2Xmax,aSPL2Ymin)) ,4); // X,Ymin

View File

@@ -79,14 +79,14 @@ private:
static void PreProcess (CGeometryDoc* aDoc,DisplayType aDisplayType);
static void PostProcess(CGeometryDoc* aDoc,UINT anID,DisplayType aDisplayType,const char* aString="",Quantity_Coefficient Coef = -1/*double zoom =-1*/);
static void DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt2d& aPoint,
const gp_Pnt2d& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset =0,
Standard_Real anYoffset =0,
Standard_Real TextScale = 0.05);
static void DisplayPoint(CGeometryDoc* aDoc,
gp_Pnt& aPoint,
const gp_Pnt& aPoint,
const char* aText,
Standard_Boolean UpdateViewer = Standard_False,
Standard_Real anXoffset = 0,

View File

@@ -243,10 +243,10 @@ void CGeometryDoc::Dump(CDumpContext& dc) const
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::DragEvent2D(const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState ,
const Handle(V3d_View)& aView )
void CGeometryDoc::DragEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Standard_Integer /*TheState*/,
const Handle(V3d_View)& /*aView*/)
{
}
@@ -254,9 +254,9 @@ void CGeometryDoc::DragEvent2D(const Standard_Integer x ,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::InputEvent2D(const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView )
void CGeometryDoc::InputEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
myAISContext2D->Select(Standard_True);
}
@@ -264,9 +264,9 @@ void CGeometryDoc::InputEvent2D(const Standard_Integer x ,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::MoveEvent2D(const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView)
void CGeometryDoc::MoveEvent2D(const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView)
{
if(aView->Viewer()->Grid()->IsActive())
{
@@ -281,19 +281,19 @@ void CGeometryDoc::MoveEvent2D(const Standard_Integer x,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::ShiftMoveEvent2D(const Standard_Integer x,
const Standard_Integer y ,
const Handle(V3d_View)& aView)
void CGeometryDoc::ShiftMoveEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::ShiftDragEvent2D(const Standard_Integer x,
const Standard_Integer y,
const Standard_Integer TheState,
const Handle(V3d_View)& aView)
void CGeometryDoc::ShiftDragEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Standard_Integer /*TheState*/,
const Handle(V3d_View)& /*aView*/)
{
}
@@ -301,18 +301,18 @@ void CGeometryDoc::ShiftDragEvent2D(const Standard_Integer x,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::ShiftInputEvent2D(const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView)
void CGeometryDoc::ShiftInputEvent2D(const Standard_Integer /*x*/,
const Standard_Integer /*y*/,
const Handle(V3d_View)& /*aView*/)
{
}
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryDoc::Popup2D(const Standard_Integer x,
const Standard_Integer y ,
const Handle(V3d_View)& aView)
void CGeometryDoc::Popup2D(const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView)
{
CMenu menu;
VERIFY(menu.LoadMenu(IDR_Popup3D));
@@ -1129,7 +1129,7 @@ void CGeometryDoc::OnSimplify()
if (!isRead)
{
Path += " was not found. The sample can not be shown.";
myCResultDialog.SetText((CString)Path.ToCString());
myCResultDialog.SetText(Path.ToCString());
return;
}
myAISContext->SetDisplayMode(AIS_Shaded);
@@ -1138,165 +1138,164 @@ void CGeometryDoc::OnSimplify()
void CGeometryDoc::simplify(const TopoDS_Shape& aShape)
{
myCResultDialog.SetTitle(CString("Simplify Face"));
myCResultDialog.SetText((CString)
" TopoDS_Shape aShape;" EOL
"" EOL
" // initialize aShape" EOL
" //aShape = ..." EOL
"" EOL
" // define parameter triangulation" EOL
" Standard_Real aDeflection = 0.1;" EOL
" " EOL
" // removes all the triangulations of the faces ," EOL
" //and all the polygons on the triangulations of the edges" EOL
" BRepTools::Clean(aShape);" EOL
" // adds a triangulation of the shape aShape with the deflection aDeflection" EOL
" BRepMesh::Mesh(aShape,aDeflection);" EOL
"" EOL
" Standard_Integer aIndex = 1, nbNodes = 0;" EOL
" " EOL
" // define two sequence of points" EOL
" TColgp_SequenceOfPnt aPoints, aPoints1;" EOL
" " EOL
" // triangulation" EOL
" for(TopExp_Explorer aExpFace(aShape,TopAbs_FACE); aExpFace.More(); aExpFace.Next())" EOL
" { " EOL
" TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());" EOL
" TopLoc_Location aLocation;" EOL
"" EOL
" // takes the triangulation of the face aFace" EOL
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);" EOL
"" EOL
" if(!aTr.IsNull())" EOL
" { " EOL
" // takes the array of nodes for this triangulation" EOL
" const TColgp_Array1OfPnt& aNodes = aTr->Nodes(); " EOL
" nbNodes = aNodes.Length();" EOL
"" EOL
" for( Standard_Integer i = 1; i <= nbNodes; i++)" EOL
" {" EOL
" // create seguence of node points in absolute coordinate system" EOL
" gp_Pnt aPnt = aNodes(i).Transformed(aLocation);" EOL
" aPoints.Append(aPnt);" EOL
" " EOL
" }" EOL
" }" EOL
" }" EOL
" " EOL
" // remove double points" EOL
" nbNodes = aPoints.Length();" EOL
" for( Standard_Integer i = 1; i <= nbNodes; i++)" EOL
" {" EOL
" gp_Pnt aPi = aPoints(i);" EOL
" for( Standard_Integer j = i + 1; j < nbNodes; j++)" EOL
" {" EOL
" gp_Pnt aPj = aPoints(j);" EOL
" if(!aPi.IsEqual(aPj,0.9))" EOL
" aIndex++;" EOL
" }" EOL
" if(aIndex == j - 1)" EOL
" aPoints1.Append(aPi);" EOL
"" EOL
" aIndex = i + 1;" EOL
" }" EOL
"" EOL
" // find max point" EOL
" aIndex = 0;" EOL
" gp_Pnt aPntMax = aPoints1(1);" EOL
" nbNodes = aPoints1.Length();" EOL
" for(i = 2; i <= nbNodes; i++)" EOL
" {" EOL
" if(aPoints1(i).X() > aPntMax.X())" EOL
" {" EOL
" aIndex = i;" EOL
" aPntMax = aPoints1(aIndex); " EOL
" } " EOL
" }" EOL
"" EOL
" // clear seguence" EOL
" aPoints.Clear();" EOL
"" EOL
" Standard_Integer nbLeftNodes = nbNodes;" EOL
"" EOL
" // ascending sort - fill aPoints with ascending " EOL
" // by X coordinate points from aPoints1" EOL
" for(i = 1; i < nbNodes; i++)" EOL
" {" EOL
" Standard_Real aMin = aPntMax.X();" EOL
" aIndex = 1;" EOL
" for( Standard_Integer j = 1; j <= nbLeftNodes; j++)" EOL
" {" EOL
" if(aPoints1(j).X() < aMin)" EOL
" {" EOL
" aMin = aPoints1(j).X();" EOL
" aIndex = j;" EOL
" } " EOL
" }" EOL
" aPoints.Append(aPoints1(aIndex));" EOL
" aPoints1.Remove(aIndex);" EOL
" nbLeftNodes = aPoints1.Length();" EOL
" }" EOL
" aPoints.Append(aPntMax);" EOL
"" EOL
" // define parameters GeomPlate_BuildPlateSurface" EOL
" Standard_Integer Degree = 3;" EOL
" Standard_Integer NbPtsOnCur = 10;" EOL
" Standard_Integer NbIter = 3;" EOL
" Standard_Integer Order = 0;" EOL
" Standard_Integer MaxSeg = 9;" EOL
" Standard_Integer MaxDegree = 5;" EOL
" Standard_Real dmax, anApproxTol = 0.001;" EOL
" Standard_Real aConstrTol = Precision::Confusion();" EOL
" " EOL
" // define object BuildPlateSurface" EOL
" GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);" EOL
" " EOL
" // add point constraints to GeomPlate_BuildPlateSurface object" EOL
" nbNodes = aPoints.Length();" EOL
" for (i = 1; i <= nbNodes; i++)" EOL
" BPSurf.Add(new GeomPlate_PointConstraint(aPoints(i), Order, aConstrTol));" EOL
"" EOL
" BPSurf.Perform();" EOL
"" EOL
" // make PlateSurface" EOL
" Handle(GeomPlate_Surface) PSurf;" EOL
" Handle(Geom_Surface) aSurf;" EOL
" " EOL
" if (BPSurf.IsDone())" EOL
" {" EOL
" PSurf = BPSurf.Surface();" EOL
"" EOL
" // define parameter approximation" EOL
" dmax = Max(0.01,10*BPSurf.G0Error());" EOL
"" EOL
" // make approximation" EOL
" GeomPlate_MakeApprox Mapp(PSurf,anApproxTol, MaxSeg,MaxDegree,dmax);" EOL
" aSurf = Mapp.Surface();" EOL
" }" EOL
" else " EOL
" return;" EOL
"" EOL
" ShapeAnalysis_FreeBounds aFreeBounds(aShape, Standard_False, Standard_True);" EOL
" TopoDS_Compound aClosedWires = aFreeBounds.GetClosedWires();" EOL
" TopTools_IndexedMapOfShape aWires;" EOL
" TopExp::MapShapes(aClosedWires, TopAbs_WIRE, aWires);" EOL
" TopoDS_Wire aWire;" EOL
" Standard_Integer nbWires = aWires.Extent();" EOL
" if (nbWires) " EOL
" aWire = TopoDS::Wire(aWires(1));" EOL
" else " EOL
" return;" EOL
"" EOL
" BRep_Builder B;" EOL
" TopoDS_Face aFace;" EOL
" B.MakeFace(aFace, aSurf, Precision::Confusion());" EOL
" B.Add(aFace, aWire);" EOL
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);" EOL
" sfs->Perform();" EOL
" TopoDS_Shape aFixedFace = sfs->Shape();" EOL
" if (aFixedFace.IsNull()) " EOL
" return;" EOL);
myCResultDialog.SetTitle("Simplify Face");
myCResultDialog.SetText(" TopoDS_Shape aShape;\n"
"\n"
" // initialize aShape\n"
" //aShape = ...\n"
"\n"
" // define parameter triangulation\n"
" Standard_Real aDeflection = 0.1;\n"
" \n"
" // removes all the triangulations of the faces ,\n"
" //and all the polygons on the triangulations of the edges\n"
" BRepTools::Clean(aShape);\n"
" // adds a triangulation of the shape aShape with the deflection aDeflection\n"
" BRepMesh::Mesh(aShape,aDeflection);\n"
"\n"
" Standard_Integer aIndex = 1, nbNodes = 0;\n"
" \n"
" // define two sequence of points\n"
" TColgp_SequenceOfPnt aPoints, aPoints1;\n"
" \n"
" // triangulation\n"
" for(TopExp_Explorer aExpFace(aShape,TopAbs_FACE); aExpFace.More(); aExpFace.Next())\n"
" { \n"
" TopoDS_Face aFace = TopoDS::Face(aExpFace.Current());\n"
" TopLoc_Location aLocation;\n"
"\n"
" // takes the triangulation of the face aFace\n"
" Handle_Poly_Triangulation aTr = BRep_Tool::Triangulation(aFace,aLocation);\n"
"\n"
" if(!aTr.IsNull())\n"
" { \n"
" // takes the array of nodes for this triangulation\n"
" const TColgp_Array1OfPnt& aNodes = aTr->Nodes(); \n"
" nbNodes = aNodes.Length();\n"
"\n"
" for( Standard_Integer i = 1; i <= nbNodes; i++)\n"
" {\n"
" // create seguence of node points in absolute coordinate system\n"
" gp_Pnt aPnt = aNodes(i).Transformed(aLocation);\n"
" aPoints.Append(aPnt);\n"
" \n"
" }\n"
" }\n"
" }\n"
" \n"
" // remove double points\n"
" nbNodes = aPoints.Length();\n"
" for( Standard_Integer i = 1; i <= nbNodes; i++)\n"
" {\n"
" gp_Pnt aPi = aPoints(i);\n"
" for( Standard_Integer j = i + 1; j < nbNodes; j++)\n"
" {\n"
" gp_Pnt aPj = aPoints(j);\n"
" if(!aPi.IsEqual(aPj,0.9))\n"
" aIndex++;\n"
" }\n"
" if(aIndex == j - 1)\n"
" aPoints1.Append(aPi);\n"
"\n"
" aIndex = i + 1;\n"
" }\n"
"\n"
" // find max point\n"
" aIndex = 0;\n"
" gp_Pnt aPntMax = aPoints1(1);\n"
" nbNodes = aPoints1.Length();\n"
" for(i = 2; i <= nbNodes; i++)\n"
" {\n"
" if(aPoints1(i).X() > aPntMax.X())\n"
" {\n"
" aIndex = i;\n"
" aPntMax = aPoints1(aIndex); \n"
" } \n"
" }\n"
"\n"
" // clear seguence\n"
" aPoints.Clear();\n"
"\n"
" Standard_Integer nbLeftNodes = nbNodes;\n"
"\n"
" // ascending sort - fill aPoints with ascending \n"
" // by X coordinate points from aPoints1\n"
" for(i = 1; i < nbNodes; i++)\n"
" {\n"
" Standard_Real aMin = aPntMax.X();\n"
" aIndex = 1;\n"
" for( Standard_Integer j = 1; j <= nbLeftNodes; j++)\n"
" {\n"
" if(aPoints1(j).X() < aMin)\n"
" {\n"
" aMin = aPoints1(j).X();\n"
" aIndex = j;\n"
" } \n"
" }\n"
" aPoints.Append(aPoints1(aIndex));\n"
" aPoints1.Remove(aIndex);\n"
" nbLeftNodes = aPoints1.Length();\n"
" }\n"
" aPoints.Append(aPntMax);\n"
"\n"
" // define parameters GeomPlate_BuildPlateSurface\n"
" Standard_Integer Degree = 3;\n"
" Standard_Integer NbPtsOnCur = 10;\n"
" Standard_Integer NbIter = 3;\n"
" Standard_Integer Order = 0;\n"
" Standard_Integer MaxSeg = 9;\n"
" Standard_Integer MaxDegree = 5;\n"
" Standard_Real dmax, anApproxTol = 0.001;\n"
" Standard_Real aConstrTol = Precision::Confusion();\n"
" \n"
" // define object BuildPlateSurface\n"
" GeomPlate_BuildPlateSurface BPSurf(Degree,NbPtsOnCur,NbIter);\n"
" \n"
" // add point constraints to GeomPlate_BuildPlateSurface object\n"
" nbNodes = aPoints.Length();\n"
" for (i = 1; i <= nbNodes; i++)\n"
" BPSurf.Add(new GeomPlate_PointConstraint(aPoints(i), Order, aConstrTol));\n"
"\n"
" BPSurf.Perform();\n"
"\n"
" // make PlateSurface\n"
" Handle(GeomPlate_Surface) PSurf;\n"
" Handle(Geom_Surface) aSurf;\n"
" \n"
" if (BPSurf.IsDone())\n"
" {\n"
" PSurf = BPSurf.Surface();\n"
"\n"
" // define parameter approximation\n"
" dmax = Max(0.01,10*BPSurf.G0Error());\n"
"\n"
" // make approximation\n"
" GeomPlate_MakeApprox Mapp(PSurf,anApproxTol, MaxSeg,MaxDegree,dmax);\n"
" aSurf = Mapp.Surface();\n"
" }\n"
" else \n"
" return;\n"
"\n"
" ShapeAnalysis_FreeBounds aFreeBounds(aShape, Standard_False, Standard_True);\n"
" TopoDS_Compound aClosedWires = aFreeBounds.GetClosedWires();\n"
" TopTools_IndexedMapOfShape aWires;\n"
" TopExp::MapShapes(aClosedWires, TopAbs_WIRE, aWires);\n"
" TopoDS_Wire aWire;\n"
" Standard_Integer nbWires = aWires.Extent();\n"
" if (nbWires) \n"
" aWire = TopoDS::Wire(aWires(1));\n"
" else \n"
" return;\n"
"\n"
" BRep_Builder B;\n"
" TopoDS_Face aFace;\n"
" B.MakeFace(aFace, aSurf, Precision::Confusion());\n"
" B.Add(aFace, aWire);\n"
" Handle_ShapeFix_Shape sfs = new ShapeFix_Shape(aFace);\n"
" sfs->Perform();\n"
" TopoDS_Shape aFixedFace = sfs->Shape();\n"
" if (aFixedFace.IsNull()) \n"
" return;\n");
// define parameter triangulation
Standard_Real aDeflection = 0.1;

View File

@@ -98,7 +98,7 @@ void CGeometryView::OnFileExportImage()
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
void CGeometryView::OnSize(UINT nType, int cx, int cy)
void CGeometryView::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
if (!myView.IsNull())
myView->MustBeResized();
@@ -213,7 +213,7 @@ void CGeometryView::OnLButtonUp(UINT nFlags, CPoint point)
} // else // if ( Ctrl )
}
void CGeometryView::OnMButtonDown(UINT nFlags, CPoint point)
void CGeometryView::OnMButtonDown(UINT nFlags, CPoint /*point*/)
{
if ( nFlags & MK_CONTROL )
{
@@ -222,7 +222,7 @@ void CGeometryView::OnMButtonDown(UINT nFlags, CPoint point)
}
}
void CGeometryView::OnMButtonUp(UINT nFlags, CPoint point)
void CGeometryView::OnMButtonUp(UINT nFlags, CPoint /*point*/)
{
if ( nFlags & MK_CONTROL )
{
@@ -248,7 +248,7 @@ void CGeometryView::OnRButtonDown(UINT nFlags, CPoint point)
}
}
void CGeometryView::OnRButtonUp(UINT nFlags, CPoint point)
void CGeometryView::OnRButtonUp(UINT /*nFlags*/, CPoint /*point*/)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->SetComputedMode (myHlrModeIsOn);
@@ -412,8 +412,8 @@ void CGeometryView::DragEvent(const Standard_Integer x ,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::InputEvent(const Standard_Integer x ,
const Standard_Integer y )
void CGeometryView::InputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/)
{
GetDocument()->GetAISContext()->Select();
}
@@ -421,8 +421,8 @@ void CGeometryView::InputEvent(const Standard_Integer x ,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::MoveEvent(const Standard_Integer x ,
const Standard_Integer y )
void CGeometryView::MoveEvent(const Standard_Integer x,
const Standard_Integer y)
{
GetDocument()->GetAISContext()->MoveTo(x,y,myView);
}
@@ -460,8 +460,8 @@ void CGeometryView::ShiftDragEvent(const Standard_Integer x ,
//-----------------------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------------------
void CGeometryView::ShiftInputEvent(const Standard_Integer x ,
const Standard_Integer y )
void CGeometryView::ShiftInputEvent(const Standard_Integer /*x*/,
const Standard_Integer /*y*/)
{
GetDocument()->GetAISContext()->ShiftSelect();
}

View File

@@ -39,7 +39,7 @@ CGeometryView2D::~CGeometryView2D()
// CNSGView drawing
void CGeometryView2D::OnDraw(CDC* pDC)
void CGeometryView2D::OnDraw(CDC* /*pDC*/)
{
CGeometryDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
@@ -170,7 +170,7 @@ void CGeometryView2D::OnLButtonUp(UINT nFlags, CPoint point)
}
void CGeometryView2D::OnMButtonDown(UINT nFlags, CPoint point)
void CGeometryView2D::OnMButtonDown(UINT nFlags, CPoint /*point*/)
{
if ( nFlags & MK_CONTROL )
{
@@ -179,7 +179,7 @@ void CGeometryView2D::OnMButtonDown(UINT nFlags, CPoint point)
}
}
void CGeometryView2D::OnMButtonUp(UINT nFlags, CPoint point)
void CGeometryView2D::OnMButtonUp(UINT nFlags, CPoint /*point*/)
{
if ( nFlags & MK_CONTROL )
{
@@ -201,7 +201,7 @@ void CGeometryView2D::OnRButtonDown(UINT nFlags, CPoint point)
}
}
void CGeometryView2D::OnRButtonUp(UINT nFlags, CPoint point)
void CGeometryView2D::OnRButtonUp(UINT /*nFlags*/, CPoint point)
{
OCC_2dView::Popup2D(point.x,point.y);
}
@@ -277,7 +277,7 @@ void CGeometryView2D::OnMouseMove(UINT nFlags, CPoint point)
}
}
void CGeometryView2D::OnSize(UINT nType, int cx, int cy)
void CGeometryView2D::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
if (!myV2dView.IsNull())
{

View File

@@ -29,9 +29,9 @@ ISession2D_Curve::ISession2D_Curve(const Handle_Geom2d_Curve aGeom2dCurve,
myradiusratio = 1;
}
void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
const Standard_Integer /*aMode*/)
{
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
@@ -118,8 +118,8 @@ void ISession2D_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPres
}
}
void ISession2D_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
void ISession2D_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
}

View File

@@ -30,7 +30,7 @@ ISession_Curve::~ISession_Curve()
{
}
void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
@@ -48,14 +48,14 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresen
}
}
void ISession_Curve::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
}
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
}

View File

@@ -25,24 +25,24 @@ ISession_Direction::ISession_Direction()
}
ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Dir& aDir,Standard_Real aLength,Standard_Real anArrowLength)
ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Dir& aDir,Standard_Real aLength,Standard_Real anArrowLength)
:myPnt(aPnt),myDir(aDir),myLength(aLength),myArrowLength(anArrowLength)
{}
ISession_Direction::ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec,Standard_Real anArrowLength)
ISession_Direction::ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec,Standard_Real anArrowLength)
:myPnt(aPnt),myDir(aVec),myArrowLength(anArrowLength)
{
myLength = aVec.Magnitude();
}
ISession_Direction::ISession_Direction(gp_Pnt2d& aPnt2d,
gp_Dir2d& aDir2d,
ISession_Direction::ISession_Direction(const gp_Pnt2d& aPnt2d,
const gp_Dir2d& aDir2d,
Standard_Real aLength)
:myPnt(gp_Pnt(aPnt2d.X(),aPnt2d.Y(),0)),myDir(gp_Dir(aDir2d.X(),aDir2d.Y(),0)),myLength(aLength)
{}
ISession_Direction::ISession_Direction(gp_Pnt2d& aPnt2d,
gp_Vec2d& aVec2d)
ISession_Direction::ISession_Direction(const gp_Pnt2d& aPnt2d,
const gp_Vec2d& aVec2d)
:myPnt(gp_Pnt(aPnt2d.X(),aPnt2d.Y(),0)),myDir(gp_Dir(aVec2d.X(),aVec2d.Y(),0))
{
myLength = aVec2d.Magnitude();
@@ -54,9 +54,9 @@ ISession_Direction::~ISession_Direction()
}
void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
const Standard_Integer /*aMode*/)
{
Handle(Prs3d_ArrowAspect) anArrowAspect = myDrawer->ArrowAspect();
anArrowAspect->SetLength(myArrowLength);
@@ -76,13 +76,13 @@ void ISession_Direction::Compute(const Handle(PrsMgr_PresentationManager3d)& aPr
}
void ISession_Direction::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
void ISession_Direction::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
}
void ISession_Direction::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
void ISession_Direction::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
}
@@ -90,3 +90,8 @@ void ISession_Direction::SetText(TCollection_ExtendedString & aText)
{
myText = aText;
}
void ISession_Direction::SetText(Standard_CString aText)
{
myText = aText;
}

View File

@@ -16,12 +16,13 @@ class ISession_Direction : public AIS_InteractiveObject
public:
TCollection_ExtendedString myText;
void SetText(TCollection_ExtendedString& aText);
void SetText(Standard_CString aText);
ISession_Direction();
ISession_Direction(gp_Pnt& aPnt,gp_Dir& aDir,Standard_Real aLength=1,Standard_Real anArrowLength=1);
ISession_Direction(gp_Pnt& aPnt,gp_Vec& aVec,Standard_Real anArrowLength=1);
ISession_Direction(const gp_Pnt& aPnt,const gp_Dir& aDir,Standard_Real aLength=1,Standard_Real anArrowLength=1);
ISession_Direction(const gp_Pnt& aPnt,const gp_Vec& aVec,Standard_Real anArrowLength=1);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Dir2d& aDir2d,Standard_Real aLength=1);
ISession_Direction(gp_Pnt2d& aPnt2d,gp_Vec2d& aVec2d);
ISession_Direction(const gp_Pnt2d& aPnt2d,const gp_Dir2d& aDir2d,Standard_Real aLength=1);
ISession_Direction(const gp_Pnt2d& aPnt2d,const gp_Vec2d& aVec2d);
virtual ~ISession_Direction();
DEFINE_STANDARD_RTTI(ISession_Direction)

View File

@@ -24,13 +24,13 @@ ISession_Point::ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z)
}
ISession_Point::ISession_Point(gp_Pnt2d& aPoint,Standard_Real Elevation)
ISession_Point::ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation)
:myPoint(gp_Pnt(aPoint.X(),aPoint.Y(),Elevation))
{
}
ISession_Point::ISession_Point(gp_Pnt& aPoint)
ISession_Point::ISession_Point(const gp_Pnt& aPoint)
:myPoint(aPoint)
{
@@ -41,9 +41,9 @@ ISession_Point::~ISession_Point()
}
void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
const Standard_Integer /*aMode*/)
{
Handle(Geom_CartesianPoint) aGeomPoint = new Geom_CartesianPoint(myPoint);
@@ -51,13 +51,13 @@ void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresen
}
void ISession_Point::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
void ISession_Point::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
}
void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode)
void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*unMode*/)
{
}

View File

@@ -19,8 +19,8 @@ class ISession_Point : public AIS_InteractiveObject
public:
ISession_Point();
ISession_Point(Standard_Real X,Standard_Real Y ,Standard_Real Z);
ISession_Point(gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
ISession_Point(gp_Pnt& aPoint);
ISession_Point(const gp_Pnt2d& aPoint,Standard_Real Elevation = 0);
ISession_Point(const gp_Pnt& aPoint);
virtual ~ISession_Point();
DEFINE_STANDARD_RTTI(ISession_Point)

View File

@@ -31,7 +31,7 @@ ISession_Surface::~ISession_Surface()
{
}
void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
{
@@ -56,12 +56,12 @@ void ISession_Surface::Compute(const Handle(PrsMgr_PresentationManager3d)& aPres
}
void ISession_Surface::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
void ISession_Surface::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
}
void ISession_Surface::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode)
void ISession_Surface::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
}

View File

@@ -62,20 +62,20 @@ ISession_Text::~ISession_Text()
}
void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode)
void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer /*aMode*/)
{
Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt( MyX ,MyY,MyZ ));
}
void ISession_Text::Compute(const Handle(Prs3d_Projector)& aProjector,
const Handle(Prs3d_Presentation)& aPresentation)
void ISession_Text::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
const Handle(Prs3d_Presentation)& /*aPresentation*/)
{
}
void ISession_Text::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode)
void ISession_Text::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*unMode*/)
{
}