mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023625: New functionality building reflect lines on a shape
Adding test case for this fix; Small corrections
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#include <DBRep.hxx>
|
||||
#include <HLRBRep_Algo.hxx>
|
||||
#include <HLRBRep_HLRToShape.hxx>
|
||||
#include <HLRAppli_ReflectLines.hxx>
|
||||
|
||||
static Handle(HLRBRep_Algo) hider;
|
||||
#ifdef WNT
|
||||
Standard_IMPORT Draw_Viewer dout;
|
||||
@@ -413,6 +415,43 @@ hres (Draw_Interpretor& , Standard_Integer n, const char** a)
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : reflectlines
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer reflectlines(Draw_Interpretor& , Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 6)
|
||||
return 1;
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(a[2]);
|
||||
if (aShape.IsNull())
|
||||
return 1;
|
||||
|
||||
Standard_Real anAISViewProjX = atof(a[3]);
|
||||
Standard_Real anAISViewProjY = atof(a[4]);
|
||||
Standard_Real anAISViewProjZ = atof(a[5]);
|
||||
|
||||
gp_Pnt anOrigin(0.,0.,0.);
|
||||
gp_Dir aNormal(anAISViewProjX, anAISViewProjY, anAISViewProjZ);
|
||||
gp_Ax2 theAxes(anOrigin, aNormal);
|
||||
gp_Dir aDX = theAxes.XDirection();
|
||||
|
||||
HLRAppli_ReflectLines Reflector(aShape);
|
||||
|
||||
Reflector.SetAxes(aNormal.X(), aNormal.Y(), aNormal.Z(),
|
||||
anOrigin.X(), anOrigin.Y(), anOrigin.Z(),
|
||||
aDX.X(), aDX.Y(), aDX.Z());
|
||||
|
||||
Reflector.Perform();
|
||||
|
||||
TopoDS_Shape Result = Reflector.GetResult();
|
||||
DBRep::Set(a[1], Result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Commands
|
||||
//purpose :
|
||||
@@ -436,6 +475,11 @@ void HLRTest::Commands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add("hdebug" ,"hdebug" ,__FILE__,hdbg,g);
|
||||
theCommands.Add("hnullify" ,"hnullify" ,__FILE__,hnul,g);
|
||||
theCommands.Add("hres2d" ,"hres2d" ,__FILE__,hres,g);
|
||||
|
||||
theCommands.Add("reflectlines",
|
||||
"reflectlines res shape proj_X proj_Y proj_Z",
|
||||
__FILE__, reflectlines, g);
|
||||
|
||||
hider = new HLRBRep_Algo();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user