7fd59977 |
1 | #include <Graphic3d_Group.hxx> |
2 | #include <Prs3d_LineAspect.hxx> |
3 | #include <TColgp_SequenceOfPnt.hxx> |
4 | |
5 | //======================================================================= |
6 | //function : Add |
7 | //purpose : |
8 | //======================================================================= |
9 | |
10 | void Prs3d_HLRShape::Add(const Handle (Prs3d_Presentation)& aPresentation, |
11 | const anyShape& aShape, |
12 | const Handle (Prs3d_Drawer)& aDrawer, |
13 | const Handle (Prs3d_Projector)& aProjector) |
14 | { |
15 | HLRShapeTool Tool(aShape,aProjector->Projector()); |
16 | Standard_Integer NbEdge = Tool.NbEdges(); |
17 | Standard_Integer i; |
18 | Standard_Real U1,U2; |
19 | anyCurve TheCurve; |
20 | Standard_Real def = aDrawer->MaximalChordialDeviation(); |
21 | Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(aPresentation); |
22 | |
23 | aGroup->SetPrimitivesAspect(aDrawer->SeenLineAspect()->Aspect()); |
24 | |
25 | aGroup->BeginPrimitives(); |
26 | Standard_Real anAngle = aDrawer->DeviationAngle(); |
27 | TColgp_SequenceOfPnt Points; |
28 | for (i=1;i<=NbEdge;i++){ |
29 | for(Tool.InitVisible(i);Tool.MoreVisible();Tool.NextVisible()){ |
30 | Tool.Visible(TheCurve,U1,U2); |
31 | CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle); |
32 | } |
33 | } |
34 | aGroup->EndPrimitives(); |
35 | |
36 | if(aDrawer->DrawHiddenLine()){ |
37 | aGroup->SetPrimitivesAspect(aDrawer->HiddenLineAspect()->Aspect()); |
38 | |
39 | aGroup->BeginPrimitives(); |
40 | for (i=1;i<=NbEdge;i++){ |
41 | for(Tool.InitHidden(i);Tool.MoreHidden();Tool.NextHidden()){ |
42 | Tool.Hidden(TheCurve,U1,U2); |
43 | CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle); |
44 | } |
45 | } |
46 | aGroup->EndPrimitives(); |
47 | } |
48 | } |
49 | |