Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:55

0001 // Created on: 1996-12-13
0002 // Created by: Jean-Pierre COMBE/Odile Olivier
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AIS_PlaneTrihedron_HeaderFile
0018 #define _AIS_PlaneTrihedron_HeaderFile
0019 
0020 #include <AIS_InteractiveObject.hxx>
0021 #include <TCollection_AsciiString.hxx>
0022 
0023 class AIS_Line;
0024 class AIS_Point;
0025 class Geom_Plane;
0026 
0027 //! To construct a selectable 2d axis system in a 3d
0028 //! drawing. This can be placed anywhere in the 3d
0029 //! system, and provides a coordinate system for
0030 //! drawing curves and shapes in a plane.
0031 //! There are 3 selection modes:
0032 //! -   mode 0   selection of the whole plane "trihedron"
0033 //! -   mode 1   selection of the origin of the plane "trihedron"
0034 //! -   mode 2   selection of the axes.
0035 //! Warning
0036 //! For the presentation of planes and trihedra, the
0037 //! millimetre is default unit of length, and 100 the default
0038 //! value for the representation of the axes. If you modify
0039 //! these dimensions, you must temporarily recover the
0040 //! Drawer object. From inside it, take the Aspects in
0041 //! which   the values for length are stocked, for example,
0042 //! PlaneAspect for planes and LineAspect for
0043 //! trihedra. Change these values and recalculate the presentation.
0044 class AIS_PlaneTrihedron : public AIS_InteractiveObject
0045 {
0046   DEFINE_STANDARD_RTTIEXT(AIS_PlaneTrihedron, AIS_InteractiveObject)
0047 public:
0048 
0049   //! Initializes the plane aPlane. The plane trihedron is
0050   //! constructed from this and an axis.
0051   Standard_EXPORT AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane);
0052   
0053   //! Returns the component specified in SetComponent.
0054   Standard_EXPORT Handle(Geom_Plane) Component();
0055   
0056   //! Creates an instance of the component object aPlane.
0057   Standard_EXPORT void SetComponent (const Handle(Geom_Plane)& aPlane);
0058   
0059   //! Returns the "XAxis".
0060   Standard_EXPORT Handle(AIS_Line) XAxis() const;
0061   
0062   //! Returns the "YAxis".
0063   Standard_EXPORT Handle(AIS_Line) YAxis() const;
0064   
0065   //! Returns the point of origin of the plane trihedron.
0066   Standard_EXPORT Handle(AIS_Point) Position() const;
0067   
0068   //! Sets the length of the X and Y axes.
0069   Standard_EXPORT void SetLength (const Standard_Real theLength);
0070   
0071   //! Returns the length of X and Y axes.
0072   Standard_EXPORT Standard_Real GetLength() const;
0073   
0074   //! Returns true if the display mode selected, aMode, is valid.
0075   Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
0076 
0077   virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; }
0078 
0079   //! Returns datum as the type of Interactive Object.
0080   virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
0081 
0082   //! Allows you to provide settings for the color aColor.
0083   Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
0084 
0085   void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }
0086 
0087   void SetYLabel (const TCollection_AsciiString& theLabel) { myYLabel = theLabel; }
0088 
0089 protected:
0090 
0091   Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager)& theprsMgr,
0092                                         const Handle(Prs3d_Presentation)& thePrs,
0093                                         const Standard_Integer theMode) Standard_OVERRIDE;
0094 
0095 private:
0096 
0097   Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSel,
0098                                                  const Standard_Integer theMode) Standard_OVERRIDE;
0099 
0100 private:
0101 
0102   Handle(Geom_Plane) myPlane;
0103   Handle(AIS_InteractiveObject) myShapes[3];
0104   TCollection_AsciiString myXLabel;
0105   TCollection_AsciiString myYLabel;
0106 
0107 };
0108 
0109 DEFINE_STANDARD_HANDLE(AIS_PlaneTrihedron, AIS_InteractiveObject)
0110 
0111 #endif // _AIS_PlaneTrihedron_HeaderFile