42cf5bc1 |
1 | // Created on: 1997-04-22 |
2 | // Created by: Guest Design |
3 | // Copyright (c) 1997-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _AIS_MultipleConnectedInteractive_HeaderFile |
18 | #define _AIS_MultipleConnectedInteractive_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <AIS_InteractiveObject.hxx> |
24 | #include <Graphic3d_TransModeFlags.hxx> |
25 | #include <AIS_KindOfInteractive.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <PrsMgr_PresentationManager3d.hxx> |
29 | #include <SelectMgr_Selection.hxx> |
30 | class AIS_InteractiveObject; |
31 | class gp_Trsf; |
32 | class gp_Pnt; |
33 | class Prs3d_Presentation; |
34 | class Prs3d_Projector; |
35 | class Geom_Transformation; |
36 | |
37 | |
38 | class AIS_MultipleConnectedInteractive; |
39 | DEFINE_STANDARD_HANDLE(AIS_MultipleConnectedInteractive, AIS_InteractiveObject) |
40 | |
41 | //! Defines an Interactive Object by gathering together |
42 | //! several object presentations. This is done through a |
43 | //! list of interactive objects. These can also be |
44 | //! Connected objects. That way memory-costly |
45 | //! calculations of presentation are avoided. |
46 | class AIS_MultipleConnectedInteractive : public AIS_InteractiveObject |
47 | { |
48 | |
49 | public: |
50 | |
51 | |
52 | //! Initializes the Interactive Object with multiple |
53 | //! connections to AIS_Interactive objects. |
54 | Standard_EXPORT AIS_MultipleConnectedInteractive(); |
55 | |
56 | //! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference. |
57 | //! Copies local transformation and transformation persistence mode from theInteractive. |
58 | //! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive) |
59 | Standard_EXPORT Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive); |
60 | |
61 | //! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference. |
62 | //! Locates instance in theLocation and copies transformation persistence mode from theInteractive. |
63 | //! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive) |
64 | Standard_EXPORT Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive, const gp_Trsf& theLocation); |
65 | |
66 | //! Establishes the connection between the Connected Interactive Object, theInteractive, and its reference. |
67 | //! Locates instance in theLocation and applies specified transformation persistence mode. |
68 | //! @return created instance object (AIS_ConnectedInteractive or AIS_MultipleConnectedInteractive) |
69 | Standard_EXPORT virtual Handle(AIS_InteractiveObject) Connect (const Handle(AIS_InteractiveObject)& theInteractive, const gp_Trsf& theLocation, const Graphic3d_TransModeFlags& theTrsfPersFlag, const gp_Pnt& theTrsfPersPoint); |
70 | |
71 | Standard_EXPORT virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE; |
72 | |
73 | Standard_EXPORT virtual Standard_Integer Signature() const Standard_OVERRIDE; |
74 | |
75 | //! Returns true if the object is connected to others. |
76 | Standard_EXPORT Standard_Boolean HasConnection() const; |
77 | |
78 | //! Removes the connection with theInteractive. |
79 | Standard_EXPORT void Disconnect (const Handle(AIS_InteractiveObject)& theInteractive); |
80 | |
81 | //! Clears all the connections to objects. |
82 | Standard_EXPORT void DisconnectAll(); |
83 | |
84 | //! computes the presentation according to a point of view |
85 | //! given by <aProjector>. |
86 | //! To be Used when the associated degenerated Presentations |
87 | //! have been transformed by <aTrsf> which is not a Pure |
88 | //! Translation. The HLR Prs can't be deducted automatically |
89 | //! WARNING :<aTrsf> must be applied |
90 | //! to the object to display before computation !!! |
91 | Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; |
92 | |
93 | Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; |
94 | |
95 | //! Informs the graphic context that the interactive Object |
96 | //! may be decomposed into sub-shapes for dynamic selection. |
97 | Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE; |
98 | |
c3282ec1 |
99 | //! Returns the owner of mode for selection of object as a whole |
100 | Standard_EXPORT virtual Handle(SelectMgr_EntityOwner) GlobalSelOwner() const Standard_OVERRIDE; |
42cf5bc1 |
101 | |
7411850a |
102 | //! Returns true if a selection corresponding to the selection mode theMode was computed for all |
103 | //! children of multiple connected interactive object. |
104 | Standard_EXPORT virtual Standard_Boolean HasSelection (const Standard_Integer theMode) const Standard_OVERRIDE; |
42cf5bc1 |
105 | |
92efcf78 |
106 | DEFINE_STANDARD_RTTIEXT(AIS_MultipleConnectedInteractive,AIS_InteractiveObject) |
42cf5bc1 |
107 | |
108 | protected: |
109 | |
110 | |
111 | //! this method is redefined virtual; |
112 | //! when the instance is connected to another |
113 | //! InteractiveObject,this method doesn't |
114 | //! compute anything, but just uses the |
115 | //! presentation of this last object, with |
116 | //! a transformation if there's one stored. |
117 | Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; |
118 | |
119 | |
120 | |
121 | private: |
122 | |
123 | |
124 | //! Computes the selection for whole subtree in scene hierarchy. |
125 | Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; |
126 | |
127 | |
128 | |
129 | }; |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | #endif // _AIS_MultipleConnectedInteractive_HeaderFile |