29 #ifndef CDPL_VIS_STRUCTUREVIEW2D_HPP
30 #define CDPL_VIS_STRUCTUREVIEW2D_HPP
66 class PropertyContainer;
81 class StructureView2DParameters;
744 void renderGraphicsPrimitives(
Renderer2D&)
const;
748 void initTextLabelBounds();
750 void createAtomPrimitives();
751 void createBondPrimitives();
753 void createHighlightingPrimitives();
755 void createAtomHighlightingPrimitives(
double,
double,
double);
756 void createAtomHighlightingPrimitives(
const Chem::Atom&,
double,
double,
double);
758 void createBondHighlightingPrimitives(
double,
double,
double);
759 void createBondHighlightingPrimitives(
const Chem::Bond&,
double,
double,
double);
770 void createAtomConfigLabelPrimitive(
const Chem::Atom&,
char);
771 void createAtomCustomLabelPrimitive(
const Chem::Atom&,
const std::string&,
bool);
774 double createBondRxnInfoLabelPrimitive(
const Chem::Bond&,
const Line2D&,
int);
775 void createBondQueryInfoLabelPrimitive(
const Chem::Bond&,
const Line2D&,
int,
double);
784 void createDownSingleBondPrimitives(
const Chem::Bond&,
const Line2D&,
bool);
785 void createEitherSingleBondPrimitives(
const Chem::Bond&,
const Line2D&,
bool);
789 void createAsymDoubleBondPrimitives(
const Chem::Bond&,
bool,
const Line2D&,
int);
796 int getBondAsymmetryShiftDirection(
const Chem::Bond&)
const;
798 bool trimLine(
Line2D&,
double,
bool)
const;
801 bool clipLineAgainstAtomBounds(
Line2D&, std::size_t,
bool)
const;
807 std::size_t getHydrogenCount(
const Chem::Atom&)
const;
812 double calcInputBondLength(
const Chem::Bond&)
const;
814 void prepareStructureData();
815 void initInputAtomPosArray();
817 void calcViewTransforms();
819 double calcAvgInputBondLength()
const;
821 void calcStdBondLengthScalingFactor();
822 void calcViewportAdjustmentScalingFactor();
824 void calcInputStructureBounds();
825 void calcOutputStructureBounds();
826 void calcOutputAtomCoords();
828 void initOutputBondLineArray();
831 std::size_t getBondOrder(
const Chem::Bond& bond)
const;
833 void setHasAtomCoordsFlag();
836 double getRxnCenterLineLength(
const Chem::Bond&)
const;
837 double getRxnCenterLineSpacing(
const Chem::Bond&)
const;
841 double getWedgeWidth(
const Chem::Bond&)
const;
842 double getHashSpacing(
const Chem::Bond&)
const;
844 double getConfigLabelSize(
const Chem::Bond&)
const;
868 double getConfigLabelSize(
const Chem::Atom&)
const;
870 double getElectronDotSize(
const Chem::Atom&)
const;
891 void setupSecondaryLabelFont(
const Chem::Atom&);
909 void freeGraphicsPrimitives();
920 typedef std::vector<const GraphicsPrimitive2D*> GraphicsPrimitiveList;
921 typedef std::vector<Rectangle2D> RectangleList;
922 typedef std::vector<RectangleList> RectangleListArray;
923 typedef std::vector<Line2D> BondLineArray;
924 typedef std::vector<std::size_t> UIntArray;
925 typedef std::pair<std::size_t, double> UIntDoublePair;
926 typedef std::vector<UIntDoublePair> UIntDoublePairList;
927 typedef std::vector<UIntDoublePairList> UIntDoublePairListArray;
928 typedef std::vector<double> DoubleArray;
937 typedef std::unique_ptr<StructureView2DParameters> StructureView2DParametersPtr;
938 typedef std::unique_ptr<Chem::Fragment> FragmentPtr;
940 StructureView2DParametersPtr parameters;
943 FragmentPtr hDepleteStructure;
951 BondLineArray outputBondLines;
952 RectangleListArray atomLabelBounds;
953 RectangleListArray bondLabelBounds;
954 UIntArray atomCoreLabelCounts;
956 UIntDoublePairListArray highlightedBondLists;
957 DoubleArray atomHighlightAreaRadii;
958 GraphicsPrimitiveList drawListLayer0;
959 GraphicsPrimitiveList drawListLayer1;
960 GraphicsPrimitiveList drawListLayer2;
961 GraphicsPrimitiveList drawListLayer3;
962 double avgInputBondLength;
963 double stdBondLengthScalingFactor;
964 double viewportAdjustmentScalingFactor;
965 double viewScalingFactor;
967 bool structureChanged;
968 bool fontMetricsChanged;
970 Font activeLabelFont;
971 Font activeSecondaryLabelFont;
972 double activeLabelMargin;
973 bool reactionContext;
Declaration of type CDPL::Util::BitSet.
Definition of class CDPL::Vis::Brush.
Definition of class CDPL::Vis::ClipPathPrimitive2D.
Definition of class CDPL::Vis::Color.
Definition of class CDPL::Vis::Font.
Definition of class CDPL::Vis::Line2D.
Definition of class CDPL::Vis::LinePrimitive2D.
Definition of class CDPL::Vis::LineSegmentListPrimitive2D.
Definition of class CDPL::Util::ObjectStack.
Definition of class CDPL::Vis::PathPrimitive2D.
Definition of class CDPL::Vis::Pen.
Definition of class CDPL::Vis::PointListPrimitive2D.
Definition of class CDPL::Vis::PolygonPrimitive2D.
Definition of class CDPL::Vis::PolylinePrimitive2D.
Definition of class CDPL::Vis::Rectangle2D.
Definition of class CDPL::Vis::SizeSpecification.
Definition of class CDPL::Vis::TextLabelPrimitive2D.
Definition of class CDPL::Math::VectorArray.
Definition of class CDPL::Vis::View2D.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
A class providing methods for the storage and lookup of object properties.
Definition: PropertyContainer.hpp:75
Atom.
Definition: Atom.hpp:52
Bond.
Definition: Bond.hpp:50
MolecularGraph.
Definition: MolecularGraph.hpp:52
Specifies the fill pattern and fill color of shapes.
Definition: Brush.hpp:50
A graphics primitive representing a clipping region in 2D space.
Definition: ClipPathPrimitive2D.hpp:51
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
An interface class with methods that provide information about the metrics of a font.
Definition: FontMetrics.hpp:71
Specifies a font for drawing text.
Definition: Font.hpp:54
Specifies a line segment in 2D space.
Definition: Line2D.hpp:48
A graphics primitive representing a single line.
Definition: LinePrimitive2D.hpp:51
A graphics primitive representing a list of disjoint line segments.
Definition: LineSegmentListPrimitive2D.hpp:51
A graphics primitive representing an arbitrary path in 2D space.
Definition: PathPrimitive2D.hpp:53
Specifies how to draw lines and outlines of shapes.
Definition: Pen.hpp:53
A graphics primitive representing a list of points.
Definition: PointListPrimitive2D.hpp:51
A graphics primitive representing a polygon.
Definition: PolygonPrimitive2D.hpp:52
A graphics primitive representing a set of connected line segments.
Definition: PolylinePrimitive2D.hpp:51
Implements the 2D visualization of chemical reactions.
Definition: ReactionView2D.hpp:589
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
An interface that provides methods for low level 2D drawing operations.
Definition: Renderer2D.hpp:86
Specifies the value and type of a size attribute and defines how the value may change during processi...
Definition: SizeSpecification.hpp:45
Implements the 2D visualization of chemical structures.
Definition: StructureView2D.hpp:680
void getModelBounds(Rectangle2D &bounds)
Calculates the bounds of the rendered structure in output space.
void setStructure(const Chem::MolecularGraph *molgraph)
Specifies the chemical structure to visualize.
~StructureView2D()
Destructor.
StructureView2D & operator=(const StructureView2D &)=delete
StructureView2D(const Chem::MolecularGraph *molgraph=0)
Constructs and initializes a StructureView2D instance for the visualization of the chemical structure...
void setFontMetrics(FontMetrics *font_metrics)
Specifies a font metrics object that will be used to measure the dimension of text labels.
StructureView2D(const StructureView2D &)=delete
const Chem::MolecularGraph * getStructure() const
Returns a pointer to the visualized chemical structure.
std::shared_ptr< StructureView2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated StructureView2D instances.
Definition: StructureView2D.hpp:686
void render(Renderer2D &renderer)
Renders the visual representation of the model using the specified Vis::Renderer2D instance.
FontMetrics * getFontMetrics() const
Returns a pointer to the used font metrics object.
A graphics primitive representing a text label.
Definition: TextLabelPrimitive2D.hpp:51
The abstract base of classes implementing the 2D visualization of data objects.
Definition: View2D.hpp:59
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.
CVector< double, 2 > Vector2D
A bounded 2 element vector holding floating point values of type double.
Definition: Vector.hpp:1632
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
boost::dynamic_bitset BitSet
A dynamic bitset class.
Definition: BitSet.hpp:46
CDPL_VIS_API const Color & getCustomLabelColor(const Chem::Atom &atom)
CDPL_VIS_API const SizeSpecification & getCustomLabelSize(const Chem::Atom &atom)
CDPL_VIS_API const Font & getLabelFont(const Chem::Atom &atom)
CDPL_VIS_API const Color & getColor(const Chem::Atom &atom)
CDPL_VIS_API const Font & getSecondaryLabelFont(const Chem::Atom &atom)
CDPL_VIS_API const Brush & getHighlightAreaBrush(const Chem::Atom &atom)
CDPL_VIS_API const SizeSpecification & getLabelSize(const Chem::Atom &atom)
CDPL_VIS_API const SizeSpecification & getDoubleBondTrimLength(const Chem::Bond &bond)
CDPL_VIS_API const SizeSpecification & getBondHighlightAreaWidth(const Chem::MolecularGraph &molgraph)
CDPL_VIS_API const SizeSpecification & getLineSpacing(const Chem::Bond &bond)
CDPL_VIS_API const SizeSpecification & getHighlightAreaOutlineWidth(const Chem::MolecularGraph &molgraph)
CDPL_VIS_API const SizeSpecification & getTripleBondTrimLength(const Chem::Bond &bond)
CDPL_VIS_API const SizeSpecification & getAtomHighlightAreaSize(const Chem::MolecularGraph &molgraph)
CDPL_VIS_API const SizeSpecification & getLineWidth(const Chem::Bond &bond)
CDPL_VIS_API const SizeSpecification & getSecondaryLabelSize(const Chem::Atom &atom)
CDPL_VIS_API const Font & getCustomLabelFont(const Chem::Atom &atom)
The namespace of the Chemical Data Processing Library.