AddSeparator(aDoc,Message);
//--------------------------------------------------------------
TCollection_AsciiString aString;
- Standard_Integer i;
- for(i = array.Lower();i<=array.Upper();i++)
+ for(int i = array.Lower();i<=array.Upper();i++)
{
gp_Pnt2d P = array(i);
TCollection_AsciiString Message2 (i);
aString = "harray ";aString += Message2;
DisplayPoint(aDoc,P,aString.ToCString(),false,0.5);
}
- for( i = harray2->Lower();i<=harray2->Upper();i++)
+ for( int i = harray2->Lower();i<=harray2->Upper();i++)
{
gp_Pnt2d P = harray2->Value(i);
TCollection_AsciiString Message2 (i);
TColgp_Array2OfPnt2d aSolutionArray(1,NbExtrema,1,2);
for(int i=1;i <= NbExtrema; i++)
{
- gp_Pnt2d P1,P2;
- ECC2.Points(i,P1,P2);
- aSolutionArray(i,1) = P1;
- aSolutionArray(i,2) = P2;
+ gp_Pnt2d P1x,P2x;
+ ECC2.Points(i,P1x,P2x);
+ aSolutionArray(i,1) = P1x;
+ aSolutionArray(i,2) = P2x;
}
//==============================================================
for(int i=1;i <= NbExtrema; i++)
{
- gp_Pnt2d P1 =aSolutionArray(i,1);
+ gp_Pnt2d P1x =aSolutionArray(i,1);
TCollection_AsciiString Message2 (i);
aString = "P1_";
aString += Message2;
- DisplayPoint(aDoc,P1,aString.ToCString(),false,0.7*i);
+ DisplayPoint(aDoc,P1x,aString.ToCString(),false,0.7*i);
- gp_Pnt2d P2 = aSolutionArray(i,2);
+ gp_Pnt2d P2x = aSolutionArray(i,2);
Handle(Geom2d_TrimmedCurve) SolutionCurve =
- GCE2d_MakeSegment(P1,P2);
+ GCE2d_MakeSegment(P1x,P2x);
Handle(ISession2D_Curve) aSolutionCurve = new ISession2D_Curve(SolutionCurve);
aDoc->GetISessionContext()->Display(aSolutionCurve, Standard_False);
}
gp_Circ2d C = gce_MakeCirc2d (P1,P2,P3);
GccEnt_QualifiedCirc QC = GccEnt::Outside(C);
GccAna_Lin2d2Tan LT (QC,P4,Precision::Confusion());
- Standard_Integer NbSol = 0;
if (LT.IsDone())
{
- NbSol = LT.NbSolutions();
+ Standard_Integer NbSol = LT.NbSolutions();
for(Standard_Integer k=1; k<=NbSol; k++)
{
gp_Lin2d L = LT.ThisSolution(k);
{
gp_Lin2d L = LT.ThisSolution(k);
Handle(Geom2d_TrimmedCurve) aLine = GCE2d_MakeSegment(L,-10,20);
- Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aLine);
- aDoc->GetISessionContext()->Display(aCurve, Standard_False);
+ Handle(ISession2D_Curve) aCurveN = new ISession2D_Curve(aLine);
+ aDoc->GetISessionContext()->Display(aCurveN, Standard_False);
}
}
Message += " C is Blue \n\n";
Message += "LT.IsDone() = ";
if (LT.IsDone()) Message += "True \n"; else Message += "False \n";
- TCollection_AsciiString Message2 (NbSol);
+ TCollection_AsciiString Message2 (LT.NbSolutions());
Message += "NbSol = "; Message += Message2 ; Message += "\n";
PostProcess(aDoc,ID_BUTTON_Test_30,TheDisplayType,Message);
for (Standard_Integer k=1; k<=NbSol; k++)
{
circ = TR.ThisSolution(k);
- Handle(Geom2d_Circle) aCircle = new Geom2d_Circle(circ);
- Handle(ISession2D_Curve) aCurve = new ISession2D_Curve(aCircle);
- aDoc->GetISessionContext()->Display(aCurve, Standard_False);
+ Handle(Geom2d_Circle) aCircleN = new Geom2d_Circle(circ);
+ Handle(ISession2D_Curve) aCurveN = new ISession2D_Curve(aCircleN);
+ aDoc->GetISessionContext()->Display(aCurveN, Standard_False);
// find the solution circle
TR.Tangency1(k,parsol,pararg,tangentpoint1);
Standard_Integer k;
if(CS.IsDone())
{
- Standard_Integer NbSeg = CS.NbSegments();
+ NbSeg = CS.NbSegments();
for (k=1; k<=NbSeg; k++)
{
TCollection_AsciiString Message2 (k);
segment = CS.Segment(k);
aString = "S_";aString += Message2;
- Handle(ISession_Curve) aCurve = new ISession_Curve(segment);
- aDoc->GetAISContext()->Display(aCurve, Standard_False);
+ Handle(ISession_Curve) aCurveN = new ISession_Curve(segment);
+ aDoc->GetAISContext()->Display(aCurveN, Standard_False);
}
for ( k=1; k<=NbPoints; k++)
TCollection_AsciiString aString;
for(Standard_Integer i = anArrayofPnt.Lower();i<=anArrayofPnt.Upper();i++){
TCollection_AsciiString Message2(i);
- gp_Pnt P = anArrayofPnt(i);
- aString = "P";aString += Message2;
- DisplayPoint(aDoc,P,aString.ToCString(),false,0.5);
+ gp_Pnt aP = anArrayofPnt(i);
+ aString = "P";
+ aString += Message2;
+ DisplayPoint(aDoc,aP,aString.ToCString(),false,0.5);
}
Message += " PE.IsPoint() = "; if (PE.IsPoint()) Message += "True \n"; else Message += "False\n";
#include <Geom_Plane.hxx>
#include <BRepTools.hxx>
-Handle(AIS_Shape) AIS1;
-TopoDS_Face F1,F2;
-TopoDS_Edge E1,E2;
+static Handle(AIS_Shape) AIS1;
+static TopoDS_Face THE_F1, THE_F2;
+static TopoDS_Edge THE_E1, THE_E2;
/////////////////////////////////////////////////////////////////////////////
// CModelingDoc
if (myAISContext->MoreCurrent()) {
Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->Current());
try {
- F1 = TopoDS::Face(ashape->Shape());
+ THE_F1 = TopoDS::Face(ashape->Shape());
}
catch(Standard_Failure){}
- if (F1.IsNull())
+ if (THE_F1.IsNull())
{
AfxMessageBox (L"Current object is not a face!\n\
Please, select a face to continue\nthe creation of a tangent surface.");
if (myState == SELECT_EDGE_PLATE_TGTES_1) {
myAISContext->InitSelected();
if (myAISContext->MoreSelected()) {
- E1 = TopoDS::Edge(myAISContext->SelectedShape());
+ THE_E1 = TopoDS::Edge(myAISContext->SelectedShape());
myAISContext->CloseLocalContext();
myState = SELECT_EDGE_PLATE_TGTES_2;
myAISContext->SetCurrentObject(aLI.First());
myAISContext->InitCurrent();
Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->Current());
- F2 = TopoDS::Face(ashape->Shape());
+ THE_F2 = TopoDS::Face(ashape->Shape());
myAISContext->OpenLocalContext();
myAISContext->Activate(ashape,2);
myState = SELECT_EDGE_PLATE_TGTES_3;
myAISContext->InitCurrent();
if (myAISContext->MoreCurrent()) {
Handle(AIS_Shape) ashape = Handle(AIS_Shape)::DownCast(myAISContext->Current());
- F2 = TopoDS::Face(ashape->Shape());
+ THE_F2 = TopoDS::Face(ashape->Shape());
myAISContext->OpenLocalContext();
myAISContext->Activate(ashape,2);
myState = SELECT_EDGE_PLATE_TGTES_3;
else if (myState == SELECT_EDGE_PLATE_TGTES_3) {
myAISContext->InitSelected();
if (myAISContext->MoreSelected()) {
- E2 = TopoDS::Edge(myAISContext->SelectedShape());
+ THE_E2 = TopoDS::Edge(myAISContext->SelectedShape());
myAISContext->CloseLocalContext();
Standard_Integer i, nbPntsOnFaces=10;
gp_Pnt P, PP;
//get the pcurve, curve and surface
- BRepAdaptor_Curve Curve3d1(E1), Curve3d2(E2);
- BRepAdaptor_Curve2d Curve2d1(E1,F1), Curve2d2(E2,F2);
- BRepAdaptor_Surface Surf1(F1), Surf2(F2);
+ BRepAdaptor_Curve Curve3d1(THE_E1), Curve3d2(THE_E2);
+ BRepAdaptor_Curve2d Curve2d1(THE_E1,THE_F1), Curve2d2(THE_E2,THE_F2);
+ BRepAdaptor_Surface Surf1(THE_F1), Surf2(THE_F2);
//compute the average plane : initial surface
Handle(TColgp_HArray1OfPnt) theTanPoints = new
// Face building ...
Handle(Geom2d_Curve)C1,C2,C3,C4;
Handle(Geom_Curve)C;
- C = BRep_Tool::Curve(E1,First,Last);
+ C = BRep_Tool::Curve(THE_E1,First,Last);
TolProj = 0.01;
C1 = GeomProjLib::Curve2d(C,First,Last,theSurface,TolProj);
TopoDS_Edge Ed1 = BRepBuilderAPI_MakeEdge(C1,theSurface).Edge();
- C = BRep_Tool::Curve(E2,First,Last);
+ C = BRep_Tool::Curve(THE_E2,First,Last);
TolProj = 0.01;
C3 = GeomProjLib::Curve2d(C,First,Last,theSurface,TolProj);
TopoDS_Edge Ed3 = BRepBuilderAPI_MakeEdge(C3,theSurface).Edge();
if (!BRepAlgo::IsValid(theFace)){
C2 = GCE2d_MakeSegment(C1->Value(C1->LastParameter()),
C3->Value(C3->FirstParameter())).Value();
- TopoDS_Edge Ed2 = BRepBuilderAPI_MakeEdge(C2,theSurface).Edge();
+ Ed2 = BRepBuilderAPI_MakeEdge(C2,theSurface).Edge();
C4 = GCE2d_MakeSegment(C3->Value(C3->LastParameter()),
C1->Value(C1->FirstParameter())).Value();
- TopoDS_Edge Ed4 = BRepBuilderAPI_MakeEdge(C4,theSurface).Edge();
+ Ed4 = BRepBuilderAPI_MakeEdge(C4,theSurface).Edge();
Ed3.Reverse();
theWire = BRepBuilderAPI_MakeWire(Ed1,Ed2,Ed3,Ed4);
theFace = BRepBuilderAPI_MakeFace(theWire);
gp_Trsf aMoveTrsf;
gp_Ax3 New(gp_Pnt(-30,-30, 0),gp_Dir(0,0,1));
- gp_Ax3 Current(aPnt,gp_Dir(0,0,1));
- aMoveTrsf.SetDisplacement(Current, New);
+ gp_Ax3 aCurrent(aPnt,gp_Dir(0,0,1));
+ aMoveTrsf.SetDisplacement(aCurrent, New);
gp_Trsf aScaleTrsf;
aScaleTrsf.SetScale(aPnt,0.0075);
aBuild1.MakeCompound(aComp1);
aBuild2.MakeCompound(aComp2);
- TopTools_SequenceOfShape aVertices;
Standard_Integer aCount = 0;
Standard_Integer aNumOfNodes = 0;
Standard_Integer aNumOfTriangles = 0;
{
// Update parameters
UpdateStandardModeForLength ();
- (CTabCtrl*) GetDlgItem (IDC_LengthTab)->ShowWindow (SW_SHOW);
- (CTabCtrl*) GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_LengthTab)->ShowWindow (SW_SHOW);
+ GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
UpdateUnitsListForLength ();
((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (15);
{
// Update parameters
UpdateStandardModeForAngle();
- (CTabCtrl*) GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_AngleTab)->ShowWindow (SW_SHOW);
- (CTabCtrl*) GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_AngleTab)->ShowWindow (SW_SHOW);
+ GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
UpdateUnitsListForAngle();
((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (15);
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
- (CTabCtrl*) GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_SHOW);
+ GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_SHOW);
UpdateUnitsListForLength();
((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (0);
myAISContext->CloseAllContexts();
myAISContext->OpenLocalContext();
myAISContext->ActivateStandardMode (TopAbs_EDGE);
- (CTabCtrl*) GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
- (CTabCtrl*) GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_SHOW);
- (CTabCtrl*) GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_LengthTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_AngleTab)->ShowWindow (SW_HIDE);
+ GetDlgItem (IDC_RadiusTab)->ShowWindow (SW_SHOW);
+ GetDlgItem (IDC_DiameterTab)->ShowWindow (SW_HIDE);
UpdateUnitsListForLength();
((CSliderCtrl*)GetDlgItem(IDC_Flyout))->SetPos (0);
if (DrawHiddenLine)
{
- Handle(Prs3d_LineAspect) aLineAspectHighlighted = new Prs3d_LineAspect(Quantity_NOC_RED,
+ Handle(Prs3d_LineAspect) aLineAspectHighlightedHLR = new Prs3d_LineAspect(Quantity_NOC_RED,
Aspect_TOL_DOTDASH,2);
- Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(Quantity_NOC_BLUE1,
+ Handle(Prs3d_LineAspect) aLineAspectHLR = new Prs3d_LineAspect(Quantity_NOC_BLUE1,
Aspect_TOL_DOTDASH,1);
switch(aMode)
{
case (6):
{
- DrawCompound(thePresentation, HCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, HCompound, aLineAspectHighlightedHLR);
break;
}
case (7):
{
- DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlightedHLR);
break;
}
case (8):
{
- DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlightedHLR);
break;
}
case (9):
{
- DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlightedHLR);
break;
}
default:
{
- DrawCompound(thePresentation, HCompound, aLineAspect);
- DrawCompound(thePresentation, Rg1LineHCompound, aLineAspect);
- DrawCompound(thePresentation, RgNLineHCompound, aLineAspect);
- DrawCompound(thePresentation, OutLineHCompound, aLineAspect);
+ DrawCompound(thePresentation, HCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, OutLineHCompound, aLineAspectHLR);
}
}
}
if (DrawHiddenLine)
{
- Handle(Prs3d_LineAspect) aLineAspectHighlighted = new Prs3d_LineAspect(Quantity_NOC_RED,
+ Handle(Prs3d_LineAspect) aLineAspectHighlightedHLR = new Prs3d_LineAspect(Quantity_NOC_RED,
Aspect_TOL_DOT,2);
- Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(Quantity_NOC_ALICEBLUE,
- Aspect_TOL_DOT,1);
- switch(aMode)
+ switch (aMode)
{
case (6):
{
- DrawCompound(thePresentation, HCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, HCompound, aLineAspectHighlightedHLR);
break;
}
case (7):
{
- DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHighlightedHLR);
break;
}
case (8):
{
- DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHighlightedHLR);
break;
}
case (9):
{
- DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, OutLineHCompound, aLineAspectHighlightedHLR);
break;
}
case (10):
{
- DrawCompound(thePresentation, IsoLineHCompound, aLineAspectHighlighted);
+ DrawCompound(thePresentation, IsoLineHCompound, aLineAspectHighlightedHLR);
break;
}
default:
{
- DrawCompound(thePresentation, HCompound, aLineAspect);
- DrawCompound(thePresentation, Rg1LineHCompound, aLineAspect);
- DrawCompound(thePresentation, RgNLineHCompound, aLineAspect);
- DrawCompound(thePresentation, OutLineHCompound, aLineAspect);
- DrawCompound(thePresentation, IsoLineHCompound, aLineAspect);
+ Handle(Prs3d_LineAspect) aLineAspectHLR =
+ new Prs3d_LineAspect(Quantity_NOC_ALICEBLUE, Aspect_TOL_DOT, 1);
+ DrawCompound(thePresentation, HCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, Rg1LineHCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, RgNLineHCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, OutLineHCompound, aLineAspectHLR);
+ DrawCompound(thePresentation, IsoLineHCompound, aLineAspectHLR);
}
}
}
VrmlData_ShapeConvert converter(scene/*, 0.001*/); // from mm to meters
Standard_Integer iShape = 1; // Counter of shapes
- for ( int i = 1; i <= aHSequenceOfShape->Length(); i++ )
- {
+ for (int i = 1; i <= aHSequenceOfShape->Length(); i++)
+ {
// Shape
- TopoDS_Shape shape = aHSequenceOfShape->Value( i );
- if ( shape.IsNull() )
- {
- ReturnMessage += " Error : Invalid shape \n";
- ReturnValue = Standard_False;
- continue;
+ TopoDS_Shape shape = aHSequenceOfShape->Value(i);
+ if (shape.IsNull())
+ {
+ ReturnMessage += " Error : Invalid shape \n";
+ ReturnValue = Standard_False;
+ continue;
}
// Color
Handle(VrmlData_Node) node = itr.Value();
if (node->DynamicType() == STANDARD_TYPE(VrmlData_ShapeNode))
{
- Handle(VrmlData_ShapeNode) shape = Handle(VrmlData_ShapeNode)::DownCast(node);
- shape->SetAppearance(appearance);
+ Handle(VrmlData_ShapeNode) aShape = Handle(VrmlData_ShapeNode)::DownCast(node);
+ aShape->SetAppearance(appearance);
}
else if (itr.Value()->DynamicType() == STANDARD_TYPE(VrmlData_Group))
{
_SYSTEM_INFO lps;
GetSystemInfo(&lps);
rep = AllocConsole();
- hCrt = _open_osfhandle((long) GetStdHandle(STD_OUTPUT_HANDLE),_O_TEXT);
+ hCrt = _open_osfhandle((intptr_t) GetStdHandle(STD_OUTPUT_HANDLE),_O_TEXT);
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
// stop the buffer on stdout