| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_RENDERING_ARCSECTOR_H |
| 7 |
#define AVOGADRO_RENDERING_ARCSECTOR_H |
| 8 |
|
| 9 |
#include "meshgeometry.h" |
| 10 |
|
| 11 |
#include <avogadro/core/array.h> |
| 12 |
|
| 13 |
namespace Avogadro { |
| 14 |
namespace Rendering { |
| 15 |
|
| 16 |
/** |
| 17 |
* @class ArcSector arcsector.h |
| 18 |
* <avogadro/rendering/arcsector.h> |
| 19 |
* @brief The ArcSector class is a convenience class for creating an arc |
| 20 |
* disk (e.g., part of a circle) from a MeshGeometry. |
| 21 |
* @see ArcStrip for the edge of a circle. |
| 22 |
*/ |
| 23 |
class AVOGADRORENDERING_EXPORT ArcSector : public MeshGeometry |
| 24 |
{ |
| 25 |
public: |
| 26 |
ArcSector() {} |
| 27 |
~ArcSector() override {} |
| 28 |
|
| 29 |
/** |
| 30 |
* Define the sector. |
| 31 |
* @param origin Center of the circle from which the arc is cut. |
| 32 |
* @param startEdge A vector defining an leading edge of the sector. The |
| 33 |
* direction is used to fix the sector's rotation about the origin, and the |
| 34 |
* length defines the radius of the sector. |
| 35 |
* @param normal The normal direction to the plane of the sector. |
| 36 |
* @param degreesCCW The extent of the sector, measured counter-clockwise from |
| 37 |
* startEdge in degrees. |
| 38 |
* @param resolutionDeg The radial width of each triangle used in the sector |
| 39 |
* approximation in degrees. This will be adjusted to fit an integral number |
| 40 |
* of triangles in the sector. Smaller triangles (better approximations) are |
| 41 |
* chosen if adjustment is needed. |
| 42 |
*/ |
| 43 |
void setArcSector(const Vector3f& origin, const Vector3f& startEdge, |
| 44 |
const Vector3f& normal, float degreesCCW, |
| 45 |
float resolutionDeg); |
| 46 |
}; |
| 47 |
|
| 48 |
} // End namespace Rendering |
| 49 |
} // End namespace Avogadro |
| 50 |
|
| 51 |
#endif // AVOGADRO_RENDERING_ARCSECTOR_H |