1 // Created on: 1995-03-15
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <StdSelect_ViewerSelector3d.hxx>
18 #include <StdSelect.hxx>
19 #include <SelectBasics_SensitiveEntity.hxx>
20 #include <Graphic3d_AspectLine3d.hxx>
23 #include <gp_Pnt2d.hxx>
26 #include <gp_GTrsf.hxx>
28 #include <Select3D_SensitiveEntity.hxx>
29 #include <Graphic3d_ArrayOfPolylines.hxx>
30 #include <Graphic3d_Group.hxx>
31 #include <Graphic3d_SequenceOfHClipPlane.hxx>
32 #include <Graphic3d_Structure.hxx>
33 #include <SelectMgr_SelectableObject.hxx>
34 #include <TColgp_HArray1OfPnt.hxx>
35 #include <TColgp_Array1OfPnt.hxx>
36 #include <TColgp_Array1OfPnt2d.hxx>
37 #include <TColgp_HArray1OfPnt2d.hxx>
38 #include <Select3D_SensitiveCurve.hxx>
39 #include <Select3D_SensitiveSegment.hxx>
40 #include <Select3D_SensitiveFace.hxx>
41 #include <Select3D_SensitiveCircle.hxx>
42 #include <Select3D_SensitivePoint.hxx>
43 #include <Select3D_SensitiveTriangulation.hxx>
44 #include <Select3D_SensitiveTriangle.hxx>
45 #include <Select3D_SensitiveWire.hxx>
46 #include <Select3D_SensitiveBox.hxx>
47 #include <SelectMgr_Selection.hxx>
48 #include <SelectMgr_EntityOwner.hxx>
50 #include <Aspect_Grid.hxx>
51 #include <Aspect_TypeOfMarker.hxx>
52 #include <Aspect_Window.hxx>
53 #include <Graphic3d_AspectMarker3d.hxx>
54 #include <Graphic3d_ArrayOfPoints.hxx>
55 #include <Poly_Connect.hxx>
56 #include <TColStd_HArray1OfInteger.hxx>
58 #include <Poly_Array1OfTriangle.hxx>
59 #include <Poly_Triangulation.hxx>
60 #include <OSD_Environment.hxx>
62 #include <V3d_View.hxx>
63 #include <V3d_Viewer.hxx>
64 #include <TColgp_SequenceOfPnt.hxx>
66 #include <OSD_Timer.hxx>
69 static Standard_Integer StdSel_NumberOfFreeEdges (const Handle(Poly_Triangulation)& Trg)
71 Standard_Integer nFree = 0;
73 Standard_Integer t[3];
74 Standard_Integer i, j;
75 for (i = 1; i <= Trg->NbTriangles(); i++)
77 pc.Triangles (i, t[0], t[1], t[2]);
78 for (j = 0; j < 3; j++)
79 if (t[j] == 0) nFree++;
84 //=======================================================================
85 // Function : Constructor
87 //=======================================================================
88 StdSelect_ViewerSelector3d::StdSelect_ViewerSelector3d() {}
90 //=======================================================================
91 // Function: SetPixelTolerance
93 //=======================================================================
94 void StdSelect_ViewerSelector3d::SetPixelTolerance (const Standard_Integer theTolerance)
96 if (myTolerances.Tolerance() != theTolerance)
99 myTolerances.ResetDefaults();
101 myTolerances.SetCustomTolerance (theTolerance);
102 myToUpdateTolerance = Standard_True;
106 //=======================================================================
109 //=======================================================================
110 void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPix,
111 const Standard_Integer theYPix,
112 const Handle(V3d_View)& theView)
114 SetClipping (theView->GetClipPlanes());
116 if(myToUpdateTolerance)
118 mySelectingVolumeMgr.SetPixelTolerance (myTolerances.Tolerance());
119 myToUpdateTolerance = Standard_False;
122 mySelectingVolumeMgr.SetCamera (theView->Camera());
123 mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Point);
124 Standard_Integer aWidth = 0, aHeight = 0;
125 theView->Window()->Size (aWidth, aHeight);
126 mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
127 gp_Pnt2d aMousePos (static_cast<Standard_Real> (theXPix),
128 static_cast<Standard_Real> (theYPix));
129 mySelectingVolumeMgr.BuildSelectingVolume (aMousePos);
131 TraverseSensitives();
134 //=======================================================================
137 //=======================================================================
138 void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPMin,
139 const Standard_Integer theYPMin,
140 const Standard_Integer theXPMax,
141 const Standard_Integer theYPMax,
142 const Handle(V3d_View)& theView)
144 mySelectingVolumeMgr.SetCamera (theView->Camera());
145 mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Box);
146 Standard_Integer aWidth = 0, aHeight = 0;
147 theView->Window()->Size (aWidth, aHeight);
148 mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
149 gp_Pnt2d aMinMousePos (static_cast<Standard_Real> (theXPMin),
150 static_cast<Standard_Real> (theYPMin));
151 gp_Pnt2d aMaxMousePos (static_cast<Standard_Real> (theXPMax),
152 static_cast<Standard_Real> (theYPMax));
153 mySelectingVolumeMgr.BuildSelectingVolume (aMinMousePos,
156 TraverseSensitives();
159 //=======================================================================
161 // Purpose : Selection using a polyline
162 //=======================================================================
163 void StdSelect_ViewerSelector3d::Pick (const TColgp_Array1OfPnt2d& thePolyline,
164 const Handle(V3d_View)& theView)
166 mySelectingVolumeMgr.SetCamera (theView->Camera());
167 mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Polyline);
168 Standard_Integer aWidth = 0, aHeight = 0;
169 theView->Window()->Size (aWidth, aHeight);
170 mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
171 mySelectingVolumeMgr.BuildSelectingVolume (thePolyline);
173 TraverseSensitives();
176 //=======================================================================
177 // Function: DisplaySensitive.
178 // Purpose : Display active primitives.
179 //=======================================================================
180 void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(V3d_View)& theView)
182 for (Standard_Integer anObjectIdx = 0; anObjectIdx <= mySelectableObjects.Size(); ++anObjectIdx)
184 const Handle (SelectMgr_SelectableObject)& anObj = mySelectableObjects.GetObjectById (anObjectIdx);
186 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
188 for (anObj->Init(); anObj->More(); anObj->Next())
190 if (anObj->CurrentSelection()->GetSelectionState() == SelectMgr_SOS_Activated)
192 ComputeSensitivePrs (aStruct, anObj->CurrentSelection(), anObj->Transformation(), Graphic3d_TransformPers());
196 myStructs.Append (aStruct);
199 for (Standard_Integer anObjectIdx = 0; anObjectIdx <= mySelectableObjectsTrsfPers.Size(); ++anObjectIdx)
201 const Handle (SelectMgr_SelectableObject)& anObj = mySelectableObjectsTrsfPers.GetObjectById (anObjectIdx);
203 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
205 if (!anObj->TransformPersistence().Flags || (anObj->TransformPersistence().Flags & Graphic3d_TMF_2d))
210 for (anObj->Init(); anObj->More(); anObj->Next())
212 if (anObj->CurrentSelection()->GetSelectionState() == SelectMgr_SOS_Activated)
214 ComputeSensitivePrs (aStruct, anObj->CurrentSelection(), anObj->Transformation(), anObj->TransformPersistence());
218 myStructs.Append (aStruct);
221 for (Standard_Integer aStructIdx = 1; aStructIdx <= myStructs.Length(); ++aStructIdx)
223 Handle(Graphic3d_Structure)& aStruct = myStructs.ChangeValue (aStructIdx);
224 aStruct->SetDisplayPriority (10);
231 //=======================================================================
232 // Function: ClearSensitive
234 //=======================================================================
235 void StdSelect_ViewerSelector3d::ClearSensitive (const Handle(V3d_View)& theView)
237 for (Standard_Integer aStructIdx = 1; aStructIdx <= myStructs.Length(); ++aStructIdx)
239 myStructs.Value (aStructIdx)->Remove();
244 if (!theView.IsNull())
250 //=======================================================================
251 //function : DisplaySenstive
253 //=======================================================================
254 void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
255 const gp_Trsf& theTrsf,
256 const Handle(V3d_View)& theView,
257 const Standard_Boolean theToClearOthers)
259 if (theToClearOthers)
261 ClearSensitive (theView);
264 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
266 ComputeSensitivePrs (aStruct, theSel, theTrsf, Graphic3d_TransformPers());
268 myStructs.Append (aStruct);
269 myStructs.Last()->SetDisplayPriority (10);
270 myStructs.Last()->Display();
275 //=======================================================================
276 //function : ComputeSensitivePrs
278 //=======================================================================
279 void StdSelect_ViewerSelector3d::ComputeSensitivePrs (const Handle(Graphic3d_Structure)& theStructure,
280 const Handle(SelectMgr_Selection)& theSel,
281 const gp_Trsf& theLoc,
282 const Graphic3d_TransformPers& theTransPers)
284 theStructure->SetTransformPersistence (theTransPers.Flags, gp_Pnt (theTransPers.Point.x(),
285 theTransPers.Point.y(),
286 theTransPers.Point.z()));
288 Handle(Graphic3d_Group) aSensGroup = theStructure->NewGroup();
290 Quantity_Color aColor (Quantity_NOC_INDIANRED3);
291 Handle(Graphic3d_AspectMarker3d) aMarkerAspect =
292 new Graphic3d_AspectMarker3d (Aspect_TOM_O_PLUS, aColor, 2.0);
294 aSensGroup->SetPrimitivesAspect (aMarkerAspect);
295 aSensGroup->SetPrimitivesAspect (
296 new Graphic3d_AspectLine3d (Quantity_NOC_GRAY40, Aspect_TOL_SOLID, 2.0));
298 Handle(Graphic3d_Group) anAreaGroup = theStructure->NewGroup();
300 anAreaGroup->SetPrimitivesAspect (
301 new Graphic3d_AspectLine3d (Quantity_NOC_AQUAMARINE1, Aspect_TOL_DASH, 1.0));
303 TColgp_SequenceOfPnt aSeqLines, aSeqFree;
304 TColStd_SequenceOfInteger aSeqBnds;
306 for (theSel->Init(); theSel->More(); theSel->Next())
308 Handle(Select3D_SensitiveEntity) Ent =
309 Handle(Select3D_SensitiveEntity)::DownCast(theSel->Sensitive()->BaseSensitive());
310 const Standard_Boolean hasloc = theLoc.Form() != gp_Identity;
316 if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveBox))
318 const Bnd_Box& B = Handle(Select3D_SensitiveBox)::DownCast (Ent)->Box();
319 Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
320 B.Get (xmin, ymin, zmin, xmax, ymax, zmax);
322 gp_Pnt theboxpoint[8] =
324 gp_Pnt(xmin,ymin,zmin),
325 gp_Pnt(xmax,ymin,zmin),
326 gp_Pnt(xmax,ymax,zmin),
327 gp_Pnt(xmin,ymax,zmin),
328 gp_Pnt(xmin,ymin,zmax),
329 gp_Pnt(xmax,ymin,zmax),
330 gp_Pnt(xmax,ymax,zmax),
331 gp_Pnt(xmin,ymax,zmax)
335 for (i = 0; i <= 7; i++)
336 theboxpoint[i].Transform (theLoc);
340 for (i = 0; i < 4; i++)
341 aSeqLines.Append(theboxpoint[i]);
342 aSeqLines.Append(theboxpoint[0]);
345 for (i = 4; i < 8; i++)
346 aSeqLines.Append(theboxpoint[i]);
347 aSeqLines.Append(theboxpoint[4]);
349 for (i = 0; i < 4; i++)
352 aSeqLines.Append(theboxpoint[i]);
353 aSeqLines.Append(theboxpoint[i+4]);
359 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveFace))
361 Handle(Select3D_SensitiveFace) aFace = Handle(Select3D_SensitiveFace)::DownCast(Ent);
362 Handle(TColgp_HArray1OfPnt) TheHPts;
363 aFace->GetPoints(TheHPts);
364 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
366 aSeqBnds.Append(ThePts.Length());
367 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
370 aSeqLines.Append(ThePts(I).Transformed (theLoc));
372 aSeqLines.Append(ThePts(I));
378 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCurve))
380 Handle(Select3D_SensitiveCurve) aCurve = Handle(Select3D_SensitiveCurve)::DownCast(Ent);
381 Handle(TColgp_HArray1OfPnt) TheHPts;
382 aCurve->Points3D(TheHPts);
383 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
385 aSeqBnds.Append(ThePts.Length());
386 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
389 aSeqLines.Append(ThePts(I).Transformed (theLoc));
391 aSeqLines.Append(ThePts(I));
397 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveWire))
399 Handle(Select3D_SensitiveWire) aWire = Handle(Select3D_SensitiveWire)::DownCast(Ent);
400 const NCollection_Vector<Handle(Select3D_SensitiveEntity)>& anEntities = aWire->GetEdges();
402 for (int i = 0; i < anEntities.Length(); i++)
404 Handle(Select3D_SensitiveEntity) SubEnt = Handle(Select3D_SensitiveEntity)::DownCast(anEntities.Value(i));
407 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveSegment))
409 gp_Pnt P1 (Handle(Select3D_SensitiveSegment)::DownCast(SubEnt)->StartPoint().XYZ());
410 gp_Pnt P2 (Handle(Select3D_SensitiveSegment)::DownCast(SubEnt)->EndPoint().XYZ());
413 P1.Transform(theLoc);
414 P2.Transform(theLoc);
417 aSeqLines.Append(P1);
418 aSeqLines.Append(P2);
422 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCircle))
424 Handle(Select3D_SensitiveCircle) aCircle = Handle(Select3D_SensitiveCircle)::DownCast(SubEnt);
425 Standard_Integer aFrom, aTo;
426 aCircle->ArrayBounds (aFrom, aTo);
428 for (Standard_Integer aPntIter = aFrom; aPntIter <= aTo; aPntIter += 2)
432 gp_Pnt (aCircle->GetPoint3d (aPntIter + 0).XYZ()),
433 gp_Pnt (aCircle->GetPoint3d (aPntIter + 1).XYZ()),
434 gp_Pnt (aCircle->GetPoint3d (aPntIter + 2).XYZ())
439 aPnts[0].Transform (theLoc);
440 aPnts[1].Transform (theLoc);
441 aPnts[2].Transform (theLoc);
445 aSeqLines.Append (aPnts[0]);
446 aSeqLines.Append (aPnts[1]);
447 aSeqLines.Append (aPnts[2]);
448 aSeqLines.Append (aPnts[0]);
453 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCurve))
455 Handle(Select3D_SensitiveCurve) aCurve = Handle(Select3D_SensitiveCurve)::DownCast(SubEnt);
456 Handle(TColgp_HArray1OfPnt) TheHPts;
457 aCurve->Points3D (TheHPts);
458 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
460 aSeqBnds.Append(ThePts.Length());
461 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
464 aSeqLines.Append(ThePts(I).Transformed (theLoc));
466 aSeqLines.Append(ThePts(I));
474 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveSegment))
476 gp_Pnt P1 (Handle(Select3D_SensitiveSegment)::DownCast(Ent)->StartPoint().XYZ());
477 gp_Pnt P2 (Handle(Select3D_SensitiveSegment)::DownCast(Ent)->EndPoint().XYZ());
480 P1.Transform (theLoc);
481 P2.Transform (theLoc);
484 aSeqLines.Append(P1);
485 aSeqLines.Append(P2);
490 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCircle))
492 Handle(Select3D_SensitiveCircle) aCircle = Handle(Select3D_SensitiveCircle)::DownCast(Ent);
493 Standard_Integer aFrom, aTo;
494 aCircle->ArrayBounds (aFrom, aTo);
496 for (Standard_Integer aPntIter = aFrom; aPntIter <= aTo; aPntIter += 2)
500 gp_Pnt (aCircle->GetPoint3d (aPntIter + 0).XYZ()),
501 gp_Pnt (aCircle->GetPoint3d (aPntIter + 1).XYZ()),
502 gp_Pnt (aCircle->GetPoint3d (aPntIter + 2).XYZ())
507 aPnts[0].Transform (theLoc);
508 aPnts[1].Transform (theLoc);
509 aPnts[2].Transform (theLoc);
513 aSeqLines.Append (aPnts[0]);
514 aSeqLines.Append (aPnts[1]);
515 aSeqLines.Append (aPnts[2]);
516 aSeqLines.Append (aPnts[0]);
522 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitivePoint))
525 Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point() :
526 Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point().Transformed (theLoc);
527 Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
528 anArrayOfPoints->AddVertex (P.X(), P.Y(), P.Z());
529 aSensGroup->AddPrimitiveArray (anArrayOfPoints);
531 //============================================================
532 // Triangulation : On met un petit offset ves l'interieur...
533 //==========================================================
534 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangulation))
536 Handle(Poly_Triangulation) PT (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->Triangulation());
538 const Poly_Array1OfTriangle& triangles = PT->Triangles();
539 const TColgp_Array1OfPnt& Nodes = PT->Nodes();
540 Standard_Integer n[3];
542 TopLoc_Location iloc, bidloc;
543 if (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->HasInitLocation())
544 bidloc = Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->GetInitLocation();
546 if (bidloc.IsIdentity())
549 iloc = theLoc * bidloc;
552 for (i = 1; i <= PT->NbTriangles(); i++)
554 triangles (i).Get (n[0], n[1], n[2]);
555 gp_Pnt P1 (Nodes (n[0]).Transformed (iloc));
556 gp_Pnt P2 (Nodes (n[1]).Transformed (iloc));
557 gp_Pnt P3 (Nodes (n[2]).Transformed (iloc));
558 gp_XYZ V1 (P1.XYZ());
559 gp_XYZ V2 (P2.XYZ());
560 gp_XYZ V3 (P3.XYZ());
561 gp_XYZ CDG (P1.XYZ()); CDG += (P2.XYZ()); CDG += (P3.XYZ()); CDG /= 3.0;
562 V1 -= CDG; V2 -= CDG; V3 -= CDG;
563 V1 *= 0.9; V2 *= 0.9; V3 *= 0.9;
564 V1 += CDG; V2 += CDG; V3 += CDG;
567 aSeqLines.Append(gp_Pnt(V1));
568 aSeqLines.Append(gp_Pnt(V2));
569 aSeqLines.Append(gp_Pnt(V3));
570 aSeqLines.Append(gp_Pnt(V1));
573 // recherche des bords libres...
575 Handle(TColStd_HArray1OfInteger) FreeEdges = new TColStd_HArray1OfInteger (1, 2 * StdSel_NumberOfFreeEdges (PT));
576 TColStd_Array1OfInteger& FreeE = FreeEdges->ChangeArray1();
577 Poly_Connect pc (PT);
578 Standard_Integer t[3];
580 Standard_Integer fr (1);
581 for (i = 1; i <= PT->NbTriangles(); i++)
583 pc.Triangles (i, t[0], t[1], t[2]);
584 triangles (i).Get (n[0], n[1], n[2]);
585 for (j = 0; j < 3; j++)
587 Standard_Integer k = (j + 1) % 3;
591 FreeE (fr + 1)= n[k];
596 for (Standard_Integer ifri = 1; ifri <= FreeE.Length(); ifri += 2)
598 gp_Pnt pe1 (Nodes (FreeE (ifri)).Transformed (iloc)), pe2 (Nodes (FreeE (ifri + 1)).Transformed (iloc));
599 aSeqFree.Append(pe1);
600 aSeqFree.Append(pe2);
603 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangle))
605 Handle(Select3D_SensitiveTriangle) Str = Handle(Select3D_SensitiveTriangle)::DownCast(Ent);
607 Str->Points3D (P1, P2, P3);
608 gp_Pnt CDG = Str->Center3D();
610 gp_XYZ V1 (P1.XYZ()); V1 -= (CDG.XYZ());
611 gp_XYZ V2 (P2.XYZ()); V2 -= (CDG.XYZ());
612 gp_XYZ V3 (P3.XYZ()); V3 -= (CDG.XYZ());
613 V1 *= 0.9; V2 *= 0.9; V3 *= 0.9;
614 V1 += CDG.XYZ(); V2 += CDG.XYZ(); V3 += CDG.XYZ();
617 aSeqLines.Append(gp_Pnt(V1));
618 aSeqLines.Append(gp_Pnt(V2));
619 aSeqLines.Append(gp_Pnt(V3));
620 aSeqLines.Append(gp_Pnt(V1));
626 if (aSeqLines.Length())
628 Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqLines.Length(),aSeqBnds.Length());
629 for (i = 1; i <= aSeqLines.Length(); i++)
630 aPrims->AddVertex(aSeqLines(i));
631 for (i = 1; i <= aSeqBnds.Length(); i++)
632 aPrims->AddBound(aSeqBnds(i));
633 anAreaGroup->AddPrimitiveArray(aPrims);
636 if (aSeqFree.Length())
638 aSensGroup->SetPrimitivesAspect (new Graphic3d_AspectLine3d (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 2.0));
639 Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqFree.Length(),aSeqFree.Length()/2);
640 for (i = 1; i <= aSeqFree.Length(); i++)
643 aPrims->AddVertex(aSeqLines(i++));
644 aPrims->AddVertex(aSeqLines(i));
646 aSensGroup->AddPrimitiveArray(aPrims);
647 aSensGroup->SetPrimitivesAspect (new Graphic3d_AspectLine3d (Quantity_NOC_GRAY40, Aspect_TOL_SOLID, 2.0));
651 //=======================================================================
652 //function : SetClipping
654 //=======================================================================
655 void StdSelect_ViewerSelector3d::SetClipping (const Graphic3d_SequenceOfHClipPlane& thePlanes)
657 myClipPlanes = thePlanes;
660 //=======================================================================
661 //function : HasDepthClipping
663 //=======================================================================
664 Standard_Boolean StdSelect_ViewerSelector3d::HasDepthClipping (const Handle(SelectMgr_EntityOwner)& theOwner) const
666 if (!theOwner->HasSelectable())
668 return Standard_False;
671 const Handle(SelectMgr_SelectableObject)& aSelectable = theOwner->Selectable();
672 return (aSelectable->GetClipPlanes().Size() > 0);