File indexing completed on 2025-01-18 10:04:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _MeshVS_Mesh_HeaderFile
0017 #define _MeshVS_Mesh_HeaderFile
0018
0019 #include <MeshVS_SequenceOfPrsBuilder.hxx>
0020 #include <MeshVS_DataMapOfIntegerOwner.hxx>
0021 #include <MeshVS_MeshSelectionMethod.hxx>
0022 #include <AIS_InteractiveObject.hxx>
0023 #include <SelectMgr_SequenceOfOwner.hxx>
0024
0025 class MeshVS_PrsBuilder;
0026 class TColStd_HPackedMapOfInteger;
0027 class MeshVS_DataSource;
0028 class MeshVS_Drawer;
0029 class SelectMgr_EntityOwner;
0030
0031 DEFINE_STANDARD_HANDLE(MeshVS_Mesh, AIS_InteractiveObject)
0032
0033
0034 class MeshVS_Mesh : public AIS_InteractiveObject
0035 {
0036
0037 public:
0038
0039
0040
0041
0042 Standard_EXPORT MeshVS_Mesh(const Standard_Boolean theIsAllowOverlapped = Standard_False);
0043
0044
0045 Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE;
0046
0047
0048
0049 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0050 const Handle(Prs3d_Presentation)& thePrs,
0051 const Standard_Integer theDispMode) Standard_OVERRIDE;
0052
0053
0054 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0055 const Standard_Integer theSelMode) Standard_OVERRIDE;
0056
0057
0058 Standard_EXPORT virtual void HilightSelected (const Handle(PrsMgr_PresentationManager)& thePrsMgr,
0059 const SelectMgr_SequenceOfOwner& theOwners) Standard_OVERRIDE;
0060
0061
0062 Standard_EXPORT virtual void HilightOwnerWithColor (const Handle(PrsMgr_PresentationManager)& thePM,
0063 const Handle(Prs3d_Drawer)& theColor,
0064 const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE;
0065
0066
0067 Standard_EXPORT virtual void ClearSelected() Standard_OVERRIDE;
0068
0069
0070 Standard_EXPORT Standard_Integer GetBuildersCount() const;
0071
0072
0073 Standard_EXPORT Handle(MeshVS_PrsBuilder) GetBuilder (const Standard_Integer Index) const;
0074
0075
0076 Standard_EXPORT Handle(MeshVS_PrsBuilder) GetBuilderById (const Standard_Integer Id) const;
0077
0078
0079
0080 Standard_EXPORT Standard_Integer GetFreeId() const;
0081
0082
0083
0084
0085
0086
0087
0088
0089 Standard_EXPORT void AddBuilder (const Handle(MeshVS_PrsBuilder)& Builder, const Standard_Boolean TreatAsHilighter = Standard_False);
0090
0091
0092 Standard_EXPORT void SetHilighter (const Handle(MeshVS_PrsBuilder)& Builder);
0093
0094
0095 Standard_EXPORT Standard_Boolean SetHilighter (const Standard_Integer Index);
0096
0097
0098 Standard_EXPORT Standard_Boolean SetHilighterById (const Standard_Integer Id);
0099
0100
0101 Standard_EXPORT Handle(MeshVS_PrsBuilder) GetHilighter() const;
0102
0103
0104
0105 Standard_EXPORT void RemoveBuilder (const Standard_Integer Index);
0106
0107
0108 Standard_EXPORT void RemoveBuilderById (const Standard_Integer Id);
0109
0110
0111 Standard_EXPORT Handle(MeshVS_PrsBuilder) FindBuilder (const Standard_CString TypeString) const;
0112
0113
0114 Standard_EXPORT const MeshVS_DataMapOfIntegerOwner& GetOwnerMaps (const Standard_Boolean IsElement);
0115
0116
0117 Standard_EXPORT Handle(MeshVS_DataSource) GetDataSource() const;
0118
0119
0120 Standard_EXPORT void SetDataSource (const Handle(MeshVS_DataSource)& aDataSource);
0121
0122
0123 Standard_EXPORT Handle(MeshVS_Drawer) GetDrawer() const;
0124
0125
0126 Standard_EXPORT void SetDrawer (const Handle(MeshVS_Drawer)& aDrawer);
0127
0128
0129
0130 Standard_EXPORT Standard_Boolean IsHiddenElem (const Standard_Integer ID) const;
0131
0132
0133
0134 Standard_EXPORT Standard_Boolean IsHiddenNode (const Standard_Integer ID) const;
0135
0136
0137 Standard_EXPORT Standard_Boolean IsSelectableElem (const Standard_Integer ID) const;
0138
0139
0140 Standard_EXPORT Standard_Boolean IsSelectableNode (const Standard_Integer ID) const;
0141
0142
0143 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetHiddenNodes() const;
0144
0145
0146
0147
0148 Standard_EXPORT void SetHiddenNodes (const Handle(TColStd_HPackedMapOfInteger)& Ids);
0149
0150
0151 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetHiddenElems() const;
0152
0153
0154 Standard_EXPORT void SetHiddenElems (const Handle(TColStd_HPackedMapOfInteger)& Ids);
0155
0156
0157 Standard_EXPORT const Handle(TColStd_HPackedMapOfInteger)& GetSelectableNodes() const;
0158
0159
0160 Standard_EXPORT void SetSelectableNodes (const Handle(TColStd_HPackedMapOfInteger)& Ids);
0161
0162
0163
0164
0165
0166
0167 Standard_EXPORT void UpdateSelectableNodes();
0168
0169
0170 Standard_EXPORT MeshVS_MeshSelectionMethod GetMeshSelMethod() const;
0171
0172
0173 Standard_EXPORT void SetMeshSelMethod (const MeshVS_MeshSelectionMethod M);
0174
0175
0176 Standard_EXPORT virtual Standard_Boolean IsWholeMeshOwner (const Handle(SelectMgr_EntityOwner)& theOwner) const;
0177
0178 friend class MeshVS_PrsBuilder;
0179
0180
0181 DEFINE_STANDARD_RTTIEXT(MeshVS_Mesh,AIS_InteractiveObject)
0182
0183 protected:
0184
0185
0186
0187
0188
0189 Standard_EXPORT void scanFacesForSharedNodes (const TColStd_PackedMapOfInteger& theAllElements,
0190 const Standard_Integer theNbMaxFaceNodes,
0191 TColStd_PackedMapOfInteger& theSharedNodes) const;
0192
0193 protected:
0194
0195
0196 MeshVS_DataMapOfIntegerOwner myNodeOwners;
0197 MeshVS_DataMapOfIntegerOwner myElementOwners;
0198 MeshVS_DataMapOfIntegerOwner my0DOwners;
0199 MeshVS_DataMapOfIntegerOwner myLinkOwners;
0200 MeshVS_DataMapOfIntegerOwner myFaceOwners;
0201 MeshVS_DataMapOfIntegerOwner myVolumeOwners;
0202 MeshVS_DataMapOfIntegerOwner myGroupOwners;
0203 MeshVS_DataMapOfIntegerOwner myMeshOwners;
0204 Handle(MeshVS_Drawer) myCurrentDrawer;
0205 Handle(MeshVS_Drawer) mySelectionDrawer;
0206 Handle(MeshVS_Drawer) myHilightDrawer;
0207 Handle(SelectMgr_EntityOwner) myWholeMeshOwner;
0208
0209
0210 private:
0211
0212
0213 MeshVS_SequenceOfPrsBuilder myBuilders;
0214 Handle(MeshVS_PrsBuilder) myHilighter;
0215 Handle(TColStd_HPackedMapOfInteger) myHiddenElements;
0216 Handle(TColStd_HPackedMapOfInteger) myHiddenNodes;
0217 Handle(TColStd_HPackedMapOfInteger) mySelectableNodes;
0218 Handle(MeshVS_DataSource) myDataSource;
0219 MeshVS_MeshSelectionMethod mySelectionMethod;
0220
0221
0222 };
0223
0224
0225
0226
0227
0228
0229
0230 #endif