Warning, file /include/opencascade/ViewerTest.hxx was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _ViewerTest_HeaderFile
0016 #define _ViewerTest_HeaderFile
0017
0018 #include <Aspect_TypeOfLine.hxx>
0019 #include <Aspect_TypeOfMarker.hxx>
0020 #include <Aspect_TypeOfTriedronPosition.hxx>
0021 #include <Draw_Interpretor.hxx>
0022 #include <Graphic3d_TypeOfShadingModel.hxx>
0023 #include <NCollection_Vec2.hxx>
0024 #include <Standard_TypeDef.hxx>
0025 #include <Graphic3d_ZLayerId.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <NCollection_HArray1.hxx>
0029 #include <TopoDS_Shape.hxx>
0030 #include <NCollection_List.hxx>
0031 #include <Quantity_ColorRGBA.hxx>
0032
0033 class AIS_InteractiveContext;
0034 class AIS_InteractiveObject;
0035 class Image_PixMap;
0036 class V3d_View;
0037 class V3d_Viewer;
0038 class ViewerTest_EventManager;
0039 class TopoDS_Shape;
0040 class WNT_WClass;
0041
0042
0043 struct ViewerTest_VinitParams
0044 {
0045 TCollection_AsciiString ViewName;
0046 TCollection_AsciiString DisplayName;
0047 occ::handle<V3d_View> ViewToClone;
0048 occ::handle<V3d_View> ParentView;
0049 NCollection_Vec2<double> Offset;
0050 NCollection_Vec2<double> Size;
0051 Aspect_TypeOfTriedronPosition Corner;
0052 NCollection_Vec2<int> SubviewMargins;
0053 bool IsVirtual;
0054 bool IsComposer;
0055
0056 ViewerTest_VinitParams()
0057 : Corner(Aspect_TOTP_LEFT_UPPER),
0058 IsVirtual(false),
0059 IsComposer(false)
0060 {
0061 }
0062 };
0063
0064 class ViewerTest
0065 {
0066 public:
0067 DEFINE_STANDARD_ALLOC
0068
0069
0070 Standard_EXPORT static void Factory(Draw_Interpretor& theDI);
0071
0072
0073
0074 Standard_EXPORT static TCollection_AsciiString ViewerInit(
0075 const ViewerTest_VinitParams& theParams);
0076
0077
0078 static TCollection_AsciiString ViewerInit(const TCollection_AsciiString& theViewName = "")
0079 {
0080 ViewerTest_VinitParams aParams;
0081 aParams.ViewName = theViewName;
0082 return ViewerInit(aParams);
0083 }
0084
0085
0086 static TCollection_AsciiString ViewerInit(
0087 const int thePxLeft,
0088 const int thePxTop,
0089 const int thePxWidth,
0090 const int thePxHeight,
0091 const TCollection_AsciiString& theViewName,
0092 const TCollection_AsciiString& theDisplayName = "",
0093 const occ::handle<V3d_View>& theViewToClone = occ::handle<V3d_View>(),
0094 const bool theIsVirtual = false)
0095 {
0096 ViewerTest_VinitParams aParams;
0097 aParams.Offset.SetValues((float)thePxLeft, (float)thePxTop);
0098 aParams.Size.SetValues((float)thePxWidth, (float)thePxHeight);
0099 aParams.ViewName = theViewName;
0100 aParams.DisplayName = theDisplayName;
0101 aParams.ViewToClone = theViewToClone;
0102 aParams.IsVirtual = theIsVirtual;
0103 return ViewerInit(aParams);
0104 }
0105
0106 Standard_EXPORT static void RemoveViewName(const TCollection_AsciiString& theName);
0107
0108 Standard_EXPORT static void InitViewName(const TCollection_AsciiString& theName,
0109 const occ::handle<V3d_View>& theView);
0110
0111 Standard_EXPORT static TCollection_AsciiString GetCurrentViewName();
0112
0113
0114 Standard_EXPORT static void ActivateView(const occ::handle<V3d_View>& theView, bool theToUpdate);
0115
0116
0117
0118 Standard_EXPORT static void RemoveView(const TCollection_AsciiString& theViewName,
0119 const bool theToRemoveContext = true);
0120
0121
0122
0123 Standard_EXPORT static void RemoveView(const occ::handle<V3d_View>& theView,
0124 const bool theToRemoveContext = true);
0125
0126
0127
0128
0129
0130
0131
0132
0133 Standard_EXPORT static bool Display(const TCollection_AsciiString& theName,
0134 const occ::handle<AIS_InteractiveObject>& theObject,
0135 const bool theToUpdate = true,
0136 const bool theReplaceIfExists = true);
0137
0138
0139
0140
0141 Standard_EXPORT static TopoDS_Shape PickShape(const TopAbs_ShapeEnum aType,
0142 const int MaxPick = 5);
0143
0144
0145
0146
0147 Standard_EXPORT static bool PickShapes(const TopAbs_ShapeEnum aType,
0148 occ::handle<NCollection_HArray1<TopoDS_Shape>>& thepicked,
0149 const int MaxPick = 5);
0150
0151 Standard_EXPORT static void Commands(Draw_Interpretor& theCommands);
0152
0153 Standard_EXPORT static void ViewerCommands(Draw_Interpretor& theCommands);
0154
0155 Standard_EXPORT static void RelationCommands(Draw_Interpretor& theCommands);
0156
0157 Standard_EXPORT static void ObjectCommands(Draw_Interpretor& theCommands);
0158
0159 Standard_EXPORT static void FilletCommands(Draw_Interpretor& theCommands);
0160
0161 Standard_EXPORT static void OpenGlCommands(Draw_Interpretor& theCommands);
0162
0163 Standard_EXPORT static void GetMousePosition(int& xpix, int& ypix);
0164
0165 Standard_EXPORT static occ::handle<V3d_Viewer> GetViewerFromContext();
0166
0167 Standard_EXPORT static occ::handle<V3d_Viewer> GetCollectorFromContext();
0168
0169 Standard_EXPORT static const occ::handle<AIS_InteractiveContext>& GetAISContext();
0170
0171 Standard_EXPORT static void SetAISContext(const occ::handle<AIS_InteractiveContext>& aContext);
0172
0173 Standard_EXPORT static const occ::handle<V3d_View>& CurrentView();
0174
0175 Standard_EXPORT static void CurrentView(const occ::handle<V3d_View>& aViou);
0176
0177 Standard_EXPORT static void Clear();
0178
0179
0180 Standard_EXPORT static void SetEventManager(const occ::handle<ViewerTest_EventManager>& theMgr);
0181
0182
0183 Standard_EXPORT static void UnsetEventManager();
0184
0185
0186
0187 Standard_EXPORT static void ResetEventManager();
0188
0189 Standard_EXPORT static occ::handle<ViewerTest_EventManager> CurrentEventManager();
0190
0191 Standard_EXPORT static void RemoveSelected();
0192
0193
0194 Standard_EXPORT static void RedrawAllViews();
0195
0196
0197
0198
0199 Standard_EXPORT static bool SplitParameter(const TCollection_AsciiString& theString,
0200 TCollection_AsciiString& theName,
0201 TCollection_AsciiString& theValue);
0202
0203
0204 Standard_EXPORT static void GetSelectedShapes(NCollection_List<TopoDS_Shape>& theShapes);
0205
0206
0207
0208 Standard_EXPORT static bool ParseLineType(const char* theArg,
0209 Aspect_TypeOfLine& theType,
0210 uint16_t& thePattern);
0211
0212
0213
0214 static bool ParseLineType(const char* theArg, Aspect_TypeOfLine& theType)
0215 {
0216 uint16_t aPattern = 0xFFFF;
0217 return ParseLineType(theArg, theType, aPattern);
0218 }
0219
0220
0221
0222 Standard_EXPORT static bool ParseMarkerType(const char* theArg,
0223 Aspect_TypeOfMarker& theType,
0224 occ::handle<Image_PixMap>& theImage);
0225
0226
0227
0228 Standard_EXPORT static bool ParseShadingModel(const char* theArg,
0229 Graphic3d_TypeOfShadingModel& theModel);
0230
0231
0232
0233
0234
0235
0236 static bool ParseZLayerName(const char* theArg, Graphic3d_ZLayerId& theLayer)
0237 {
0238 return parseZLayer(theArg, false, theLayer);
0239 }
0240
0241
0242
0243
0244
0245
0246 static bool ParseZLayer(const char* theArg, Graphic3d_ZLayerId& theLayer)
0247 {
0248 return parseZLayer(theArg, true, theLayer);
0249 }
0250
0251
0252 Standard_EXPORT static bool ParseCorner(const char* theArg,
0253 Aspect_TypeOfTriedronPosition& theCorner);
0254
0255 public:
0256
0257
0258 Standard_DEPRECATED("Method has been moved to Draw::ParseColor()")
0259 Standard_EXPORT static int ParseColor(const int theArgNb,
0260 const char* const* const theArgVec,
0261 Quantity_ColorRGBA& theColor);
0262
0263
0264
0265 Standard_DEPRECATED("Method has been moved to Draw::ParseColor()")
0266 Standard_EXPORT static int ParseColor(const int theArgNb,
0267 const char* const* const theArgVec,
0268 Quantity_Color& theColor);
0269
0270
0271
0272 Standard_DEPRECATED("Method has been moved to Draw::ParseOnOff()")
0273 Standard_EXPORT static bool ParseOnOff(const char* theArg, bool& theIsOn);
0274
0275 Standard_DEPRECATED("Method has been moved to Quantity_Color::ColorFromName()")
0276 Standard_EXPORT static Quantity_NameOfColor GetColorFromName(const char* const name);
0277
0278 private:
0279
0280
0281
0282
0283
0284
0285 Standard_EXPORT static bool parseZLayer(const char* theArg,
0286 bool theToAllowInteger,
0287 Graphic3d_ZLayerId& theLayer);
0288
0289
0290
0291
0292
0293
0294
0295 static const occ::handle<WNT_WClass>& WClass();
0296 };
0297
0298 #endif