|
Chemical Data Processing Library C++ API - Version 1.0.0
|
Go to the documentation of this file.
29 #ifndef CDPL_VIS_STRUCTUREVIEW2D_HPP
30 #define CDPL_VIS_STRUCTUREVIEW2D_HPP
62 class PropertyContainer;
78 class StructureView2DParameters;
491 class CustomGraphicsData;
494 typedef std::shared_ptr<CustomGraphicsData> CustomGraphicsDataPtr;
495 typedef std::vector<CustomGraphicsDataPtr> CustomGraphicsDataList;
504 void renderGraphicsPrimitives(
Renderer2D&)
const;
508 void initTextLabelBounds();
510 void createAtomPrimitives();
521 void createBondPrimitives();
524 double createBondRxnInfoLabelPrimitive(
const Chem::Bond&,
const Line2D&,
int);
525 void createBondQueryInfoLabelPrimitive(
const Chem::Bond&,
const Line2D&,
int,
double);
532 void createDownSingleBondPrimitives(
const Chem::Bond&,
const Line2D&,
bool);
533 void createEitherSingleBondPrimitives(
const Chem::Bond&,
const Line2D&,
bool);
537 void createAsymDoubleBondPrimitives(
const Chem::Bond&,
bool,
const Line2D&,
int);
544 int getBondAsymmetryShiftDirection(
const Chem::Bond&)
const;
546 bool trimLine(
Line2D&,
double,
bool)
const;
549 bool clipLineAgainstAtomBounds(
Line2D&, std::size_t,
bool)
const;
555 std::size_t getHydrogenCount(
const Chem::Atom&)
const;
560 double calcInputBondLength(
const Chem::Bond&)
const;
562 void prepareStructureData();
563 void initInputAtomPosTable();
565 void calcViewTransforms();
567 double calcAvgInputBondLength()
const;
569 void calcStdBondLengthScalingFactor();
570 void calcViewportAdjustmentScalingFactor();
572 void calcInputStructureBounds();
573 void calcOutputStructureBounds();
574 void calcOutputAtomCoords();
576 void initOutputBondLineTable();
579 std::size_t getBondOrder(
const Chem::Bond& bond)
const;
581 void setHasAtomCoordsFlag();
584 double getRxnCenterLineLength(
const Chem::Bond&)
const;
585 double getRxnCenterLineSpacing(
const Chem::Bond&)
const;
589 double getWedgeWidth(
const Chem::Bond&)
const;
590 double getHashSpacing(
const Chem::Bond&)
const;
604 double getElectronDotSize(
const Chem::Atom&)
const;
617 void setupSecondaryLabelFont(
const Chem::Atom&);
625 void freeGraphicsPrimitives();
634 typedef std::vector<const GraphicsPrimitive2D*> GraphicsPrimitiveList;
635 typedef std::vector<Rectangle2D> RectangleList;
636 typedef std::vector<RectangleList> RectangleListTable;
637 typedef std::vector<Line2D> BondLineTable;
645 typedef std::unique_ptr<StructureView2DParameters> StructureView2DParametersPtr;
646 typedef std::unique_ptr<Chem::Fragment> FragmentPtr;
648 StructureView2DParametersPtr parameters;
651 FragmentPtr hDepleteStructure;
659 BondLineTable outputBondLines;
660 RectangleListTable atomLabelBounds;
661 RectangleList bondLabelBounds;
662 GraphicsPrimitiveList drawList;
663 double avgInputBondLength;
664 double stdBondLengthScalingFactor;
665 double viewportAdjustmentScalingFactor;
666 double viewScalingFactor;
668 bool structureChanged;
669 bool fontMetricsChanged;
671 Font activeLabelFont;
672 Font activeSecondaryLabelFont;
673 double activeLabelMargin;
674 bool reactionContext;
686 #endif // CDPL_VIS_STRUCTUREVIEW2D_HPP
Specifies the value and type of a size attribute and defines how the value may change during processi...
Definition: SizeSpecification.hpp:45
An interface that provides methods for low level 2D drawing operations.
Definition: Renderer2D.hpp:81
Definition of the class CDPL::Util::ObjectStack.
CDPL_VIS_API const Font & getSecondaryLabelFont(const Chem::Atom &atom)
Definition of the class CDPL::Vis::SizeSpecification.
Definition of the class CDPL::Math::VectorArray.
The abstract base of classes implementing the 2D visualization of data objects.
Definition: View2D.hpp:59
~StructureView2D()
Destructor.
Definition of the class CDPL::Vis::Font.
Implements the 2D visualization of chemical reactions.
Definition: ReactionView2D.hpp:590
Definition of the class CDPL::Vis::LineSegmentListPrimitive2D.
CDPL_VIS_API const Font & getLabelFont(const Chem::Atom &atom)
Bond.
Definition: Bond.hpp:50
FontMetrics * getFontMetrics() const
Returns a pointer to the used font metrics object.
CDPL_VIS_API const SizeSpecification & getSecondaryLabelSize(const Chem::Atom &atom)
CDPL_VIS_API const SizeSpecification & getDoubleBondTrimLength(const Chem::Bond &bond)
Specifies how to draw lines and outlines of shapes.
Definition: Pen.hpp:53
Definition of the class CDPL::Vis::PointListPrimitive2D.
A graphics primitive representing a single line.
Definition: LinePrimitive2D.hpp:51
CDPL_VIS_API const Color & getColor(const Chem::Atom &atom)
Atom.
Definition: Atom.hpp:52
A graphics primitive representing a list of disjoint line segments.
Definition: LineSegmentListPrimitive2D.hpp:51
Definition of the class CDPL::Vis::PolygonPrimitive2D.
StructureView2D(const Chem::MolecularGraph *molgraph=0)
Constructs and initializes a StructureView2D instance for the visualization of the chemical structure...
Specifies a font for drawing text.
Definition: Font.hpp:54
Implements the 2D visualization of chemical structures.
Definition: StructureView2D.hpp:437
Definition of the class CDPL::Vis::Pen.
void setFontMetrics(FontMetrics *font_metrics)
Specifies a font metrics object that will be used to measure the dimension of text labels.
MolecularGraph.
Definition: MolecularGraph.hpp:52
std::shared_ptr< StructureView2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated StructureView2D instances.
Definition: StructureView2D.hpp:443
CDPL_VIS_API const SizeSpecification & getLabelSize(const Chem::Atom &atom)
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Vis::PolylinePrimitive2D.
CDPL_VIS_API const SizeSpecification & getTripleBondTrimLength(const Chem::Bond &bond)
Definition of the class CDPL::Vis::LinePrimitive2D.
Definition of the class CDPL::Vis::View2D.
A graphics primitive representing a text label.
Definition: TextLabelPrimitive2D.hpp:51
void setStructure(const Chem::MolecularGraph *molgraph)
Specifies the chemical structure to visualize.
const Chem::MolecularGraph * getStructure() const
Returns a pointer to the visualized chemical structure.
A class providing methods for the storage and lookup of object properties.
Definition: PropertyContainer.hpp:75
ValueType calcBondAngle(const CoordsVec &term_atom1_pos, const CoordsVec &ctr_atom_pos, const CoordsVec &term_atom2_pos)
Calculates the bond angle between the two bonds i-j and j-k.
A graphics primitive representing a polygon.
Definition: PolygonPrimitive2D.hpp:52
The namespace of the Chemical Data Processing Library.
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
void getModelBounds(Rectangle2D &bounds)
Calculates the bounds of the rendered structure in output space.
CVector< double, 2 > Vector2D
A bounded 2 element vector holding floating point values of type double.
Definition: Vector.hpp:1632
Definition of the class CDPL::Vis::Rectangle2D.
Definition of the class CDPL::Vis::Line2D.
void render(Renderer2D &renderer)
Renders the visual representation of the model using the specified Vis::Renderer2D instance.
CDPL_VIS_API const SizeSpecification & getLineSpacing(const Chem::Bond &bond)
An interface class with methods that provide information about the metrics of a font.
Definition: FontMetrics.hpp:71
VectorArray< Vector2D > Vector2DArray
An array of Math::Vector2D objects.
Definition: VectorArray.hpp:79
Array< unsigned int > UIArray
An array of unsigned integers.
Definition: Array.hpp:562
Definition of the class CDPL::Vis::Color.
Definition of the preprocessor macro CDPL_VIS_API.
CDPL_VIS_API const SizeSpecification & getLineWidth(const Chem::Bond &bond)
A graphics primitive representing a list of points.
Definition: PointListPrimitive2D.hpp:51
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
Specifies a line segment in 2D space.
Definition: Line2D.hpp:48
Definition of the class CDPL::Vis::TextLabelPrimitive2D.
A graphics primitive representing a set of connected line segments.
Definition: PolylinePrimitive2D.hpp:51