29 #ifndef CDPL_VIS_REACTIONVIEW2D_HPP
30 #define CDPL_VIS_REACTIONVIEW2D_HPP
62 class ReactionView2DParameters;
885 void renderGraphicsPrimitives(
Renderer2D&)
const;
889 void initComponentViews();
890 void initComponentBoundsTable();
891 void layoutReaction();
892 void calcOutputTransforms();
893 void initComponentViewViewports();
894 void createPlusSignPrimitives();
895 void createArrowPrimitives();
897 void createStdReactionArrow(
bool);
899 void layoutComponents(
unsigned int, std::size_t, std::size_t);
900 void createPackedComponentLayout(
unsigned int, std::size_t, std::size_t);
901 void createLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
902 void createHLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
903 void createVLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
908 void shiftComponentPositions(std::size_t, std::size_t,
const Math::Vector2D&);
909 void shiftPlusSignPositions(std::size_t, std::size_t,
const Math::Vector2D&);
911 void calcArrowDimensions();
912 void calcPlusSignDimensions();
914 void freeComponentViews();
915 void freeGraphicsPrimitives();
917 void initArrowStyle();
918 void initArrowLength();
926 void initComponentLayout();
927 void initComponentLayoutDirection();
928 void initComponentMargin();
929 void initComponentVisibility();
930 void initAgentAlignment();
931 void initAgentLayout();
932 void initAgentLayoutDirection();
938 void initPlusSignVisibility();
944 typedef std::vector<StructureView2D*> ComponentViewList;
945 typedef std::vector<const GraphicsPrimitive2D*> GraphicsPrimitiveList;
946 typedef std::map<const Chem::MolecularGraph*, Rectangle2D> ComponentBoundsMap;
951 typedef std::unique_ptr<ReactionView2DParameters> ReactionView2DParametersPtr;
954 ReactionView2DParametersPtr parameters;
956 ComponentViewList componentViews;
957 GraphicsPrimitiveList drawList;
960 ComponentBoundsMap componentBounds;
961 Vector2DArray componentPositions;
962 Vector2DArray plusSignPositions;
964 double unscaledArrowLength;
965 double unscaledArrowHeadLength;
966 double unscaledArrowHeadWidth;
967 double unscaledArrowShaftWidth;
968 double unscaledArrowLineWidth;
969 double maxUnscaledArrowWidth;
970 double unscaledPlusSignSize;
971 double unscaledPlusSignLineWidth;
972 double outputScalingFactor;
974 unsigned int arrowStyle;
976 unsigned int componentLayout;
977 unsigned int componentLayoutDirection;
979 unsigned int agentAlignment;
980 unsigned int agentLayout;
981 unsigned int agentLayoutDirection;
985 bool plusSignsVisible;
986 bool reactionChanged;
987 bool fontMetricsChanged;
Definition of class CDPL::Vis::Color.
Definition of class CDPL::Vis::LineSegmentListPrimitive2D.
Definition of class CDPL::Util::ObjectStack.
Definition of class CDPL::Vis::PolygonPrimitive2D.
Definition of class CDPL::Vis::Rectangle2D.
Definition of class CDPL::Vis::SizeSpecification.
Definition of class CDPL::Vis::StructureView2D.
Definition of vector data types.
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.
Abstract base class representing a mutable molecular graph that owns its atoms and bonds.
Definition: Molecule.hpp:53
Abstract base class for chemical reactions composed of role-tagged Chem::Molecule components.
Definition: Reaction.hpp:59
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
Interface providing methods for querying information about the metrics of a font.
Definition: FontMetrics.hpp:71
2D graphics primitive representing a list of disjoint line segments.
Definition: LineSegmentListPrimitive2D.hpp:51
2D graphics primitive representing a polygon.
Definition: PolygonPrimitive2D.hpp:52
Implements the 2D visualization of chemical reactions.
Definition: ReactionView2D.hpp:829
~ReactionView2D()
Destructor.
ReactionView2D & operator=(const ReactionView2D &)=delete
const Chem::Reaction * getReaction() const
Returns a pointer to the visualized chemical reaction.
FontMetrics * getFontMetrics() const
Returns a pointer to the Vis::FontMetrics instance used for measuring the dimension of text labels.
void setReaction(const Chem::Reaction *rxn)
Specifies the chemical reaction to visualize.
void setFontMetrics(FontMetrics *font_metrics)
Specifies a Vis::FontMetrics instance that will be used to measure the dimension of text labels.
void getModelBounds(Rectangle2D &bounds)
Calculates the axis-aligned bounding rectangle of the visualized model.
ReactionView2D(const Chem::Reaction *rxn=0)
Constructs and initializes a ReactionView2D instance for the visualization of the chemical reaction r...
void render(Renderer2D &renderer)
Renders the visual representation of the model using the specified Vis::Renderer2D instance.
std::shared_ptr< ReactionView2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ReactionView2D instances.
Definition: ReactionView2D.hpp:835
ReactionView2D(const ReactionView2D &)=delete
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
Interface providing 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
The abstract base of classes implementing the 2D visualization of data objects.
Definition: View2D.hpp:59
CVector< double, 2 > Vector2D
Bounded 2 element vector holding floating-point values of type double.
Definition: Vector.hpp:3213
VectorArray< Vector2D > Vector2DArray
Array storing vectors of type Math::Vector2D.
Definition: VectorArray.hpp:82
CDPL_VIS_API const SizeSpecification & getArrowHeadLength(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::ARROW_HEAD_LENGTH property of the reaction rxn.
CDPL_VIS_API const SizeSpecification & getArrowLineWidth(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::ARROW_LINE_WIDTH property of the reaction rxn.
CDPL_VIS_API const Color & getArrowColor(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::ARROW_COLOR property of the reaction rxn.
CDPL_VIS_API const SizeSpecification & getPlusSignLineWidth(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::PLUS_SIGN_LINE_WIDTH property of the reaction rxn.
CDPL_VIS_API const SizeSpecification & getPlusSignSize(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::PLUS_SIGN_SIZE property of the reaction rxn.
CDPL_VIS_API unsigned int getComponentLayoutDirection(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::COMPONENT_LAYOUT_DIRECTION property of the reaction r...
CDPL_VIS_API unsigned int getComponentLayout(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::COMPONENT_LAYOUT property of the reaction rxn.
CDPL_VIS_API const SizeSpecification & getArrowHeadWidth(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::ARROW_HEAD_WIDTH property of the reaction rxn.
CDPL_VIS_API const SizeSpecification & getArrowShaftWidth(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::ARROW_SHAFT_WIDTH property of the reaction rxn.
CDPL_VIS_API const Color & getPlusSignColor(const Chem::Reaction &rxn)
Returns the value of the Vis::ReactionProperty::PLUS_SIGN_COLOR property of the reaction rxn.
The namespace of the Chemical Data Processing Library.