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 IMPLEMENT_STANDARD_RTTIEXT(StdSelect_ViewerSelector3d,SelectMgr_ViewerSelector)
71 static Standard_Integer StdSel_NumberOfFreeEdges (const Handle(Poly_Triangulation)& Trg)
73 Standard_Integer nFree = 0;
75 Standard_Integer t[3];
76 Standard_Integer i, j;
77 for (i = 1; i <= Trg->NbTriangles(); i++)
79 pc.Triangles (i, t[0], t[1], t[2]);
80 for (j = 0; j < 3; j++)
81 if (t[j] == 0) nFree++;
86 //=======================================================================
87 // Function : Constructor
89 //=======================================================================
90 StdSelect_ViewerSelector3d::StdSelect_ViewerSelector3d() {}
92 //=======================================================================
93 // Function: SetPixelTolerance
95 //=======================================================================
96 void StdSelect_ViewerSelector3d::SetPixelTolerance (const Standard_Integer theTolerance)
98 if (myTolerances.Tolerance() != theTolerance)
100 if (theTolerance < 0)
101 myTolerances.ResetDefaults();
103 myTolerances.SetCustomTolerance (theTolerance);
104 myToUpdateTolerance = Standard_True;
108 //=======================================================================
111 //=======================================================================
112 void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPix,
113 const Standard_Integer theYPix,
114 const Handle(V3d_View)& theView)
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);
130 mySelectingVolumeMgr.SetViewClipping (theView->GetClipPlanes());
132 TraverseSensitives();
135 //=======================================================================
138 //=======================================================================
139 void StdSelect_ViewerSelector3d::Pick (const Standard_Integer theXPMin,
140 const Standard_Integer theYPMin,
141 const Standard_Integer theXPMax,
142 const Standard_Integer theYPMax,
143 const Handle(V3d_View)& theView)
145 mySelectingVolumeMgr.SetCamera (theView->Camera());
146 mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Box);
147 Standard_Integer aWidth = 0, aHeight = 0;
148 theView->Window()->Size (aWidth, aHeight);
149 mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
150 gp_Pnt2d aMinMousePos (static_cast<Standard_Real> (theXPMin),
151 static_cast<Standard_Real> (theYPMin));
152 gp_Pnt2d aMaxMousePos (static_cast<Standard_Real> (theXPMax),
153 static_cast<Standard_Real> (theYPMax));
154 mySelectingVolumeMgr.BuildSelectingVolume (aMinMousePos,
157 TraverseSensitives();
160 //=======================================================================
162 // Purpose : Selection using a polyline
163 //=======================================================================
164 void StdSelect_ViewerSelector3d::Pick (const TColgp_Array1OfPnt2d& thePolyline,
165 const Handle(V3d_View)& theView)
167 mySelectingVolumeMgr.SetCamera (theView->Camera());
168 mySelectingVolumeMgr.SetActiveSelectionType (SelectMgr_SelectingVolumeManager::Polyline);
169 Standard_Integer aWidth = 0, aHeight = 0;
170 theView->Window()->Size (aWidth, aHeight);
171 mySelectingVolumeMgr.SetWindowSize (aWidth, aHeight);
172 mySelectingVolumeMgr.BuildSelectingVolume (thePolyline);
174 TraverseSensitives();
177 //=======================================================================
178 // Function: DisplaySensitive.
179 // Purpose : Display active primitives.
180 //=======================================================================
181 void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(V3d_View)& theView)
183 for (Standard_Integer anObjectIdx = 0; anObjectIdx <= mySelectableObjects.Size(); ++anObjectIdx)
185 const Handle (SelectMgr_SelectableObject)& anObj = mySelectableObjects.GetObjectById (anObjectIdx);
187 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
189 for (anObj->Init(); anObj->More(); anObj->Next())
191 if (anObj->CurrentSelection()->GetSelectionState() == SelectMgr_SOS_Activated)
193 ComputeSensitivePrs (aStruct, anObj->CurrentSelection(), anObj->Transformation(), Graphic3d_TransformPers());
197 myStructs.Append (aStruct);
200 for (Standard_Integer anObjectIdx = 0; anObjectIdx <= mySelectableObjectsTrsfPers.Size(); ++anObjectIdx)
202 const Handle (SelectMgr_SelectableObject)& anObj = mySelectableObjectsTrsfPers.GetObjectById (anObjectIdx);
204 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
206 if (!anObj->TransformPersistence().Flags || (anObj->TransformPersistence().Flags & Graphic3d_TMF_2d))
211 for (anObj->Init(); anObj->More(); anObj->Next())
213 if (anObj->CurrentSelection()->GetSelectionState() == SelectMgr_SOS_Activated)
215 ComputeSensitivePrs (aStruct, anObj->CurrentSelection(), anObj->Transformation(), anObj->TransformPersistence());
219 myStructs.Append (aStruct);
222 for (Standard_Integer aStructIdx = 1; aStructIdx <= myStructs.Length(); ++aStructIdx)
224 Handle(Graphic3d_Structure)& aStruct = myStructs.ChangeValue (aStructIdx);
225 aStruct->SetDisplayPriority (10);
232 //=======================================================================
233 // Function: ClearSensitive
235 //=======================================================================
236 void StdSelect_ViewerSelector3d::ClearSensitive (const Handle(V3d_View)& theView)
238 for (Standard_Integer aStructIdx = 1; aStructIdx <= myStructs.Length(); ++aStructIdx)
240 myStructs.Value (aStructIdx)->Remove();
245 if (!theView.IsNull())
251 //=======================================================================
252 //function : DisplaySenstive
254 //=======================================================================
255 void StdSelect_ViewerSelector3d::DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
256 const gp_Trsf& theTrsf,
257 const Handle(V3d_View)& theView,
258 const Standard_Boolean theToClearOthers)
260 if (theToClearOthers)
262 ClearSensitive (theView);
265 Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (theView->Viewer()->StructureManager());
267 ComputeSensitivePrs (aStruct, theSel, theTrsf, Graphic3d_TransformPers());
269 myStructs.Append (aStruct);
270 myStructs.Last()->SetDisplayPriority (10);
271 myStructs.Last()->Display();
276 //=======================================================================
277 //function : ComputeSensitivePrs
279 //=======================================================================
280 void StdSelect_ViewerSelector3d::ComputeSensitivePrs (const Handle(Graphic3d_Structure)& theStructure,
281 const Handle(SelectMgr_Selection)& theSel,
282 const gp_Trsf& theLoc,
283 const Graphic3d_TransformPers& theTransPers)
285 theStructure->SetTransformPersistence (theTransPers.Flags, gp_Pnt (theTransPers.Point.x(),
286 theTransPers.Point.y(),
287 theTransPers.Point.z()));
289 Handle(Graphic3d_Group) aSensGroup = theStructure->NewGroup();
291 Quantity_Color aColor (Quantity_NOC_INDIANRED3);
292 Handle(Graphic3d_AspectMarker3d) aMarkerAspect =
293 new Graphic3d_AspectMarker3d (Aspect_TOM_O_PLUS, aColor, 2.0);
295 aSensGroup->SetPrimitivesAspect (aMarkerAspect);
296 aSensGroup->SetPrimitivesAspect (
297 new Graphic3d_AspectLine3d (Quantity_NOC_GRAY40, Aspect_TOL_SOLID, 2.0));
299 Handle(Graphic3d_Group) anAreaGroup = theStructure->NewGroup();
301 anAreaGroup->SetPrimitivesAspect (
302 new Graphic3d_AspectLine3d (Quantity_NOC_AQUAMARINE1, Aspect_TOL_DASH, 1.0));
304 TColgp_SequenceOfPnt aSeqLines, aSeqFree;
305 TColStd_SequenceOfInteger aSeqBnds;
307 for (theSel->Init(); theSel->More(); theSel->Next())
309 Handle(Select3D_SensitiveEntity) Ent =
310 Handle(Select3D_SensitiveEntity)::DownCast(theSel->Sensitive()->BaseSensitive());
311 const Standard_Boolean hasloc = theLoc.Form() != gp_Identity;
317 if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveBox))
319 const Bnd_Box& B = Handle(Select3D_SensitiveBox)::DownCast (Ent)->Box();
320 Standard_Real xmin, ymin, zmin, xmax, ymax, zmax;
321 B.Get (xmin, ymin, zmin, xmax, ymax, zmax);
323 gp_Pnt theboxpoint[8] =
325 gp_Pnt(xmin,ymin,zmin),
326 gp_Pnt(xmax,ymin,zmin),
327 gp_Pnt(xmax,ymax,zmin),
328 gp_Pnt(xmin,ymax,zmin),
329 gp_Pnt(xmin,ymin,zmax),
330 gp_Pnt(xmax,ymin,zmax),
331 gp_Pnt(xmax,ymax,zmax),
332 gp_Pnt(xmin,ymax,zmax)
336 for (i = 0; i <= 7; i++)
337 theboxpoint[i].Transform (theLoc);
341 for (i = 0; i < 4; i++)
342 aSeqLines.Append(theboxpoint[i]);
343 aSeqLines.Append(theboxpoint[0]);
346 for (i = 4; i < 8; i++)
347 aSeqLines.Append(theboxpoint[i]);
348 aSeqLines.Append(theboxpoint[4]);
350 for (i = 0; i < 4; i++)
353 aSeqLines.Append(theboxpoint[i]);
354 aSeqLines.Append(theboxpoint[i+4]);
360 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveFace))
362 Handle(Select3D_SensitiveFace) aFace = Handle(Select3D_SensitiveFace)::DownCast(Ent);
363 Handle(TColgp_HArray1OfPnt) TheHPts;
364 aFace->GetPoints(TheHPts);
365 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
367 aSeqBnds.Append(ThePts.Length());
368 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
371 aSeqLines.Append(ThePts(I).Transformed (theLoc));
373 aSeqLines.Append(ThePts(I));
379 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCurve))
381 Handle(Select3D_SensitiveCurve) aCurve = Handle(Select3D_SensitiveCurve)::DownCast(Ent);
382 Handle(TColgp_HArray1OfPnt) TheHPts;
383 aCurve->Points3D(TheHPts);
384 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
386 aSeqBnds.Append(ThePts.Length());
387 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
390 aSeqLines.Append(ThePts(I).Transformed (theLoc));
392 aSeqLines.Append(ThePts(I));
398 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveWire))
400 Handle(Select3D_SensitiveWire) aWire = Handle(Select3D_SensitiveWire)::DownCast(Ent);
401 const NCollection_Vector<Handle(Select3D_SensitiveEntity)>& anEntities = aWire->GetEdges();
403 for (int i = 0; i < anEntities.Length(); i++)
405 Handle(Select3D_SensitiveEntity) SubEnt = anEntities.Value(i);
408 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveSegment))
410 gp_Pnt P1 (Handle(Select3D_SensitiveSegment)::DownCast(SubEnt)->StartPoint().XYZ());
411 gp_Pnt P2 (Handle(Select3D_SensitiveSegment)::DownCast(SubEnt)->EndPoint().XYZ());
414 P1.Transform(theLoc);
415 P2.Transform(theLoc);
418 aSeqLines.Append(P1);
419 aSeqLines.Append(P2);
423 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCircle))
425 Handle(Select3D_SensitiveCircle) aCircle = Handle(Select3D_SensitiveCircle)::DownCast(SubEnt);
426 Standard_Integer aFrom, aTo;
427 aCircle->ArrayBounds (aFrom, aTo);
429 for (Standard_Integer aPntIter = aFrom; aPntIter <= aTo; aPntIter += 2)
433 gp_Pnt (aCircle->GetPoint3d (aPntIter + 0).XYZ()),
434 gp_Pnt (aCircle->GetPoint3d (aPntIter + 1).XYZ()),
435 gp_Pnt (aCircle->GetPoint3d (aPntIter + 2).XYZ())
440 aPnts[0].Transform (theLoc);
441 aPnts[1].Transform (theLoc);
442 aPnts[2].Transform (theLoc);
446 aSeqLines.Append (aPnts[0]);
447 aSeqLines.Append (aPnts[1]);
448 aSeqLines.Append (aPnts[2]);
449 aSeqLines.Append (aPnts[0]);
454 if (SubEnt->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCurve))
456 Handle(Select3D_SensitiveCurve) aCurve = Handle(Select3D_SensitiveCurve)::DownCast(SubEnt);
457 Handle(TColgp_HArray1OfPnt) TheHPts;
458 aCurve->Points3D (TheHPts);
459 const TColgp_Array1OfPnt& ThePts = TheHPts->Array1();
461 aSeqBnds.Append(ThePts.Length());
462 for (Standard_Integer I = ThePts.Lower(); I <= ThePts.Upper(); I++)
465 aSeqLines.Append(ThePts(I).Transformed (theLoc));
467 aSeqLines.Append(ThePts(I));
475 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveSegment))
477 gp_Pnt P1 (Handle(Select3D_SensitiveSegment)::DownCast(Ent)->StartPoint().XYZ());
478 gp_Pnt P2 (Handle(Select3D_SensitiveSegment)::DownCast(Ent)->EndPoint().XYZ());
481 P1.Transform (theLoc);
482 P2.Transform (theLoc);
485 aSeqLines.Append(P1);
486 aSeqLines.Append(P2);
491 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveCircle))
493 Handle(Select3D_SensitiveCircle) aCircle = Handle(Select3D_SensitiveCircle)::DownCast(Ent);
494 Standard_Integer aFrom, aTo;
495 aCircle->ArrayBounds (aFrom, aTo);
497 for (Standard_Integer aPntIter = aFrom; aPntIter <= aTo; aPntIter += 2)
501 gp_Pnt (aCircle->GetPoint3d (aPntIter + 0).XYZ()),
502 gp_Pnt (aCircle->GetPoint3d (aPntIter + 1).XYZ()),
503 gp_Pnt (aCircle->GetPoint3d (aPntIter + 2).XYZ())
508 aPnts[0].Transform (theLoc);
509 aPnts[1].Transform (theLoc);
510 aPnts[2].Transform (theLoc);
514 aSeqLines.Append (aPnts[0]);
515 aSeqLines.Append (aPnts[1]);
516 aSeqLines.Append (aPnts[2]);
517 aSeqLines.Append (aPnts[0]);
523 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitivePoint))
526 Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point() :
527 Handle(Select3D_SensitivePoint)::DownCast(Ent)->Point().Transformed (theLoc);
528 Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
529 anArrayOfPoints->AddVertex (P.X(), P.Y(), P.Z());
530 aSensGroup->AddPrimitiveArray (anArrayOfPoints);
532 //============================================================
533 // Triangulation : On met un petit offset ves l'interieur...
534 //==========================================================
535 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangulation))
537 Handle(Poly_Triangulation) PT (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->Triangulation());
539 const Poly_Array1OfTriangle& triangles = PT->Triangles();
540 const TColgp_Array1OfPnt& Nodes = PT->Nodes();
541 Standard_Integer n[3];
543 TopLoc_Location iloc, bidloc;
544 if (Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->HasInitLocation())
545 bidloc = Handle(Select3D_SensitiveTriangulation)::DownCast (Ent)->GetInitLocation();
547 if (bidloc.IsIdentity())
550 iloc = theLoc * bidloc;
553 for (i = 1; i <= PT->NbTriangles(); i++)
555 triangles (i).Get (n[0], n[1], n[2]);
556 gp_Pnt P1 (Nodes (n[0]).Transformed (iloc));
557 gp_Pnt P2 (Nodes (n[1]).Transformed (iloc));
558 gp_Pnt P3 (Nodes (n[2]).Transformed (iloc));
559 gp_XYZ V1 (P1.XYZ());
560 gp_XYZ V2 (P2.XYZ());
561 gp_XYZ V3 (P3.XYZ());
562 gp_XYZ CDG (P1.XYZ()); CDG += (P2.XYZ()); CDG += (P3.XYZ()); CDG /= 3.0;
563 V1 -= CDG; V2 -= CDG; V3 -= CDG;
564 V1 *= 0.9; V2 *= 0.9; V3 *= 0.9;
565 V1 += CDG; V2 += CDG; V3 += CDG;
568 aSeqLines.Append(gp_Pnt(V1));
569 aSeqLines.Append(gp_Pnt(V2));
570 aSeqLines.Append(gp_Pnt(V3));
571 aSeqLines.Append(gp_Pnt(V1));
574 // recherche des bords libres...
576 Handle(TColStd_HArray1OfInteger) FreeEdges = new TColStd_HArray1OfInteger (1, 2 * StdSel_NumberOfFreeEdges (PT));
577 TColStd_Array1OfInteger& FreeE = FreeEdges->ChangeArray1();
578 Poly_Connect pc (PT);
579 Standard_Integer t[3];
581 Standard_Integer fr (1);
582 for (i = 1; i <= PT->NbTriangles(); i++)
584 pc.Triangles (i, t[0], t[1], t[2]);
585 triangles (i).Get (n[0], n[1], n[2]);
586 for (j = 0; j < 3; j++)
588 Standard_Integer k = (j + 1) % 3;
592 FreeE (fr + 1)= n[k];
597 for (Standard_Integer ifri = 1; ifri <= FreeE.Length(); ifri += 2)
599 gp_Pnt pe1 (Nodes (FreeE (ifri)).Transformed (iloc)), pe2 (Nodes (FreeE (ifri + 1)).Transformed (iloc));
600 aSeqFree.Append(pe1);
601 aSeqFree.Append(pe2);
604 else if (Ent->DynamicType()==STANDARD_TYPE(Select3D_SensitiveTriangle))
606 Handle(Select3D_SensitiveTriangle) Str = Handle(Select3D_SensitiveTriangle)::DownCast(Ent);
608 Str->Points3D (P1, P2, P3);
609 gp_Pnt CDG = Str->Center3D();
611 gp_XYZ V1 (P1.XYZ()); V1 -= (CDG.XYZ());
612 gp_XYZ V2 (P2.XYZ()); V2 -= (CDG.XYZ());
613 gp_XYZ V3 (P3.XYZ()); V3 -= (CDG.XYZ());
614 V1 *= 0.9; V2 *= 0.9; V3 *= 0.9;
615 V1 += CDG.XYZ(); V2 += CDG.XYZ(); V3 += CDG.XYZ();
618 aSeqLines.Append(gp_Pnt(V1));
619 aSeqLines.Append(gp_Pnt(V2));
620 aSeqLines.Append(gp_Pnt(V3));
621 aSeqLines.Append(gp_Pnt(V1));
627 if (aSeqLines.Length())
629 Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqLines.Length(),aSeqBnds.Length());
630 for (i = 1; i <= aSeqLines.Length(); i++)
631 aPrims->AddVertex(aSeqLines(i));
632 for (i = 1; i <= aSeqBnds.Length(); i++)
633 aPrims->AddBound(aSeqBnds(i));
634 anAreaGroup->AddPrimitiveArray(aPrims);
637 if (aSeqFree.Length())
639 aSensGroup->SetPrimitivesAspect (new Graphic3d_AspectLine3d (Quantity_NOC_GREEN, Aspect_TOL_SOLID, 2.0));
640 Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(aSeqFree.Length(),aSeqFree.Length()/2);
641 for (i = 1; i <= aSeqFree.Length(); i++)
644 aPrims->AddVertex(aSeqLines(i++));
645 aPrims->AddVertex(aSeqLines(i));
647 aSensGroup->AddPrimitiveArray(aPrims);
648 aSensGroup->SetPrimitivesAspect (new Graphic3d_AspectLine3d (Quantity_NOC_GRAY40, Aspect_TOL_SOLID, 2.0));
652 //=======================================================================
653 //function : HasDepthClipping
655 //=======================================================================
656 Standard_Boolean StdSelect_ViewerSelector3d::HasDepthClipping (const Handle(SelectMgr_EntityOwner)& theOwner) const
658 if (!theOwner->HasSelectable())
660 return Standard_False;
663 const Handle(SelectMgr_SelectableObject)& aSelectable = theOwner->Selectable();
664 return (aSelectable->GetClipPlanes().Size() > 0);