File indexing completed on 2025-01-18 10:04:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef _IMeshTools_Context_HeaderFile
0017 #define _IMeshTools_Context_HeaderFile
0018
0019 #include <Standard_Type.hxx>
0020 #include <IMeshTools_ModelBuilder.hxx>
0021 #include <IMeshData_Model.hxx>
0022 #include <IMeshTools_Parameters.hxx>
0023 #include <IMeshTools_ModelAlgo.hxx>
0024 #include <Message_ProgressRange.hxx>
0025
0026
0027
0028
0029 class IMeshTools_Context : public IMeshData_Shape
0030 {
0031 public:
0032
0033
0034 IMeshTools_Context()
0035 {
0036 }
0037
0038
0039 virtual ~IMeshTools_Context()
0040 {
0041 }
0042
0043
0044
0045 virtual Standard_Boolean BuildModel ()
0046 {
0047 if (myModelBuilder.IsNull())
0048 {
0049 return Standard_False;
0050 }
0051
0052 myModel = myModelBuilder->Perform(GetShape(), myParameters);
0053
0054 return !myModel.IsNull();
0055 }
0056
0057
0058
0059 virtual Standard_Boolean DiscretizeEdges()
0060 {
0061 if (myModel.IsNull() || myEdgeDiscret.IsNull())
0062 {
0063 return Standard_False;
0064 }
0065
0066
0067 return myEdgeDiscret->Perform(myModel, myParameters, Message_ProgressRange());
0068 }
0069
0070
0071
0072
0073 virtual Standard_Boolean HealModel()
0074 {
0075 if (myModel.IsNull())
0076 {
0077 return Standard_False;
0078 }
0079
0080 return myModelHealer.IsNull() ?
0081 Standard_True :
0082 myModelHealer->Perform (myModel, myParameters, Message_ProgressRange());
0083 }
0084
0085
0086
0087
0088 virtual Standard_Boolean PreProcessModel()
0089 {
0090 if (myModel.IsNull())
0091 {
0092 return Standard_False;
0093 }
0094
0095 return myPreProcessor.IsNull() ?
0096 Standard_True :
0097 myPreProcessor->Perform (myModel, myParameters, Message_ProgressRange());
0098 }
0099
0100
0101
0102 virtual Standard_Boolean DiscretizeFaces (const Message_ProgressRange& theRange)
0103 {
0104 if (myModel.IsNull() || myFaceDiscret.IsNull())
0105 {
0106 return Standard_False;
0107 }
0108
0109
0110 return myFaceDiscret->Perform (myModel, myParameters, theRange);
0111 }
0112
0113
0114
0115 virtual Standard_Boolean PostProcessModel()
0116 {
0117 if (myModel.IsNull())
0118 {
0119 return Standard_False;
0120 }
0121
0122 return myPostProcessor.IsNull() ?
0123 Standard_True :
0124 myPostProcessor->Perform(myModel, myParameters, Message_ProgressRange());
0125 }
0126
0127
0128 virtual void Clean()
0129 {
0130 if (myParameters.CleanModel)
0131 {
0132 myModel.Nullify();
0133 }
0134 }
0135
0136
0137 const Handle (IMeshTools_ModelBuilder)& GetModelBuilder () const
0138 {
0139 return myModelBuilder;
0140 }
0141
0142
0143 void SetModelBuilder (const Handle (IMeshTools_ModelBuilder)& theBuilder)
0144 {
0145 myModelBuilder = theBuilder;
0146 }
0147
0148
0149 const Handle (IMeshTools_ModelAlgo)& GetEdgeDiscret () const
0150 {
0151 return myEdgeDiscret;
0152 }
0153
0154
0155 void SetEdgeDiscret (const Handle (IMeshTools_ModelAlgo)& theEdgeDiscret)
0156 {
0157 myEdgeDiscret = theEdgeDiscret;
0158 }
0159
0160
0161 const Handle(IMeshTools_ModelAlgo)& GetModelHealer() const
0162 {
0163 return myModelHealer;
0164 }
0165
0166
0167 void SetModelHealer(const Handle(IMeshTools_ModelAlgo)& theModelHealer)
0168 {
0169 myModelHealer = theModelHealer;
0170 }
0171
0172
0173 const Handle(IMeshTools_ModelAlgo)& GetPreProcessor() const
0174 {
0175 return myPreProcessor;
0176 }
0177
0178
0179 void SetPreProcessor(const Handle(IMeshTools_ModelAlgo)& thePreProcessor)
0180 {
0181 myPreProcessor = thePreProcessor;
0182 }
0183
0184
0185 const Handle(IMeshTools_ModelAlgo)& GetFaceDiscret() const
0186 {
0187 return myFaceDiscret;
0188 }
0189
0190
0191 void SetFaceDiscret(const Handle(IMeshTools_ModelAlgo)& theFaceDiscret)
0192 {
0193 myFaceDiscret = theFaceDiscret;
0194 }
0195
0196
0197 const Handle(IMeshTools_ModelAlgo)& GetPostProcessor() const
0198 {
0199 return myPostProcessor;
0200 }
0201
0202
0203 void SetPostProcessor(const Handle(IMeshTools_ModelAlgo)& thePostProcessor)
0204 {
0205 myPostProcessor = thePostProcessor;
0206 }
0207
0208
0209 const IMeshTools_Parameters& GetParameters () const
0210 {
0211 return myParameters;
0212 }
0213
0214
0215 IMeshTools_Parameters& ChangeParameters ()
0216 {
0217 return myParameters;
0218 }
0219
0220
0221 const Handle (IMeshData_Model)& GetModel () const
0222 {
0223 return myModel;
0224 }
0225
0226 DEFINE_STANDARD_RTTIEXT(IMeshTools_Context, IMeshData_Shape)
0227
0228 private:
0229
0230 Handle (IMeshTools_ModelBuilder) myModelBuilder;
0231 Handle (IMeshData_Model) myModel;
0232 Handle (IMeshTools_ModelAlgo) myEdgeDiscret;
0233 Handle (IMeshTools_ModelAlgo) myModelHealer;
0234 Handle (IMeshTools_ModelAlgo) myPreProcessor;
0235 Handle (IMeshTools_ModelAlgo) myFaceDiscret;
0236 Handle (IMeshTools_ModelAlgo) myPostProcessor;
0237 IMeshTools_Parameters myParameters;
0238 };
0239
0240 #endif