Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:15:31

0001 // Created on: 1997-01-21
0002 // Created by: Prestataire Christiane ARMAND
0003 // Copyright (c) 1997-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_Circle_HeaderFile
0018 #define _AIS_Circle_HeaderFile
0019 
0020 #include <AIS_InteractiveObject.hxx>
0021 
0022 class Geom_Circle;
0023 
0024 //! Constructs circle datums to be used in construction of
0025 //! composite shapes.
0026 class AIS_Circle : public AIS_InteractiveObject
0027 {
0028   DEFINE_STANDARD_RTTIEXT(AIS_Circle, AIS_InteractiveObject)
0029 public:
0030   //! Initializes this algorithm for constructing AIS circle
0031   //! datums initializes the circle aCircle
0032   Standard_EXPORT AIS_Circle(const occ::handle<Geom_Circle>& aCircle);
0033 
0034   //! Initializes this algorithm for constructing AIS circle datums.
0035   //! Initializes the circle theCircle, the arc
0036   //! starting point theUStart, the arc ending point theUEnd,
0037   //! and the type of sensitivity theIsFilledCircleSens.
0038   Standard_EXPORT AIS_Circle(const occ::handle<Geom_Circle>& theCircle,
0039                              const double                    theUStart,
0040                              const double                    theUEnd,
0041                              const bool                      theIsFilledCircleSens = false);
0042 
0043   //! Returns index 6 by default.
0044   int Signature() const override { return 6; }
0045 
0046   //! Indicates that the type of Interactive Object is a datum.
0047   AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Datum; }
0048 
0049   //! Returns the circle component defined in SetCircle.
0050   const occ::handle<Geom_Circle>& Circle() const { return myComponent; }
0051 
0052   //! Constructs instances of the starting point and the end
0053   //! point parameters, theU1 and theU2.
0054   void Parameters(double& theU1, double& theU2) const
0055   {
0056     theU1 = myUStart;
0057     theU2 = myUEnd;
0058   }
0059 
0060   //! Allows you to provide settings for the circle datum aCircle.
0061   void SetCircle(const occ::handle<Geom_Circle>& theCircle) { myComponent = theCircle; }
0062 
0063   //! Allows you to set the parameter theU for the starting point of an arc.
0064   void SetFirstParam(const double theU)
0065   {
0066     myUStart      = theU;
0067     myCircleIsArc = true;
0068   }
0069 
0070   //! Allows you to provide the parameter theU for the end point of an arc.
0071   void SetLastParam(const double theU)
0072   {
0073     myUEnd        = theU;
0074     myCircleIsArc = true;
0075   }
0076 
0077   Standard_EXPORT void SetColor(const Quantity_Color& aColor) override;
0078 
0079   //! Assigns the width aValue to the solid line boundary of the circle datum.
0080   Standard_EXPORT void SetWidth(const double aValue) override;
0081 
0082   //! Removes color from the solid line boundary of the circle datum.
0083   Standard_EXPORT void UnsetColor() override;
0084 
0085   //! Removes width settings from the solid line boundary of the circle datum.
0086   Standard_EXPORT void UnsetWidth() override;
0087 
0088   //! Returns the type of sensitivity for the circle;
0089   bool IsFilledCircleSens() const { return myIsFilledCircleSens; }
0090 
0091   //! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to true
0092   //! then the whole circle will be detectable, otherwise only the boundary of the circle.
0093   void SetFilledCircleSens(const bool theIsFilledCircleSens)
0094   {
0095     myIsFilledCircleSens = theIsFilledCircleSens;
0096   }
0097 
0098 private:
0099   Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
0100                                const occ::handle<Prs3d_Presentation>&         theprs,
0101                                const int                                      theMode) override;
0102 
0103   Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
0104                                         const int                               theMode) override;
0105 
0106   Standard_EXPORT void ComputeCircle(const occ::handle<Prs3d_Presentation>& aPresentation);
0107 
0108   Standard_EXPORT void ComputeArc(const occ::handle<Prs3d_Presentation>& aPresentation);
0109 
0110   Standard_EXPORT void ComputeCircleSelection(const occ::handle<SelectMgr_Selection>& aSelection);
0111 
0112   Standard_EXPORT void ComputeArcSelection(const occ::handle<SelectMgr_Selection>& aSelection);
0113 
0114   //! Replace aspects of already computed groups with the new value.
0115   void replaceWithNewLineAspect(const occ::handle<Prs3d_LineAspect>& theAspect);
0116 
0117 private:
0118   occ::handle<Geom_Circle> myComponent;
0119   double                   myUStart;
0120   double                   myUEnd;
0121   bool                     myCircleIsArc;
0122   bool                     myIsFilledCircleSens;
0123 };
0124 
0125 #endif // _AIS_Circle_HeaderFile