29 #ifndef CDPL_VIS_REACTIONVIEW2D_HPP
30 #define CDPL_VIS_REACTIONVIEW2D_HPP
62 class ReactionView2DParameters;
657 void renderGraphicsPrimitives(
Renderer2D&)
const;
661 void initComponentViews();
662 void initComponentBoundsTable();
663 void layoutReaction();
664 void calcOutputTransforms();
665 void initComponentViewViewports();
666 void createPlusSignPrimitives();
667 void createArrowPrimitives();
669 void createStdReactionArrow(
bool);
671 void layoutComponents(
unsigned int, std::size_t, std::size_t);
672 void createPackedComponentLayout(
unsigned int, std::size_t, std::size_t);
673 void createLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
674 void createHLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
675 void createVLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
680 void shiftComponentPositions(std::size_t, std::size_t,
const Math::Vector2D&);
681 void shiftPlusSignPositions(std::size_t, std::size_t,
const Math::Vector2D&);
683 void calcArrowDimensions();
684 void calcPlusSignDimensions();
686 void freeComponentViews();
687 void freeGraphicsPrimitives();
689 void initArrowStyle();
690 void initArrowLength();
698 void initComponentLayout();
699 void initComponentLayoutDirection();
700 void initComponentMargin();
701 void initComponentVisibility();
702 void initAgentAlignment();
703 void initAgentLayout();
704 void initAgentLayoutDirection();
710 void initPlusSignVisibility();
716 typedef std::vector<StructureView2D*> ComponentViewList;
717 typedef std::vector<const GraphicsPrimitive2D*> GraphicsPrimitiveList;
718 typedef std::map<const Chem::MolecularGraph*, Rectangle2D> ComponentBoundsMap;
723 typedef std::unique_ptr<ReactionView2DParameters> ReactionView2DParametersPtr;
726 ReactionView2DParametersPtr parameters;
728 ComponentViewList componentViews;
729 GraphicsPrimitiveList drawList;
732 ComponentBoundsMap componentBounds;
733 Vector2DArray componentPositions;
734 Vector2DArray plusSignPositions;
736 double unscaledArrowLength;
737 double unscaledArrowHeadLength;
738 double unscaledArrowHeadWidth;
739 double unscaledArrowShaftWidth;
740 double unscaledArrowLineWidth;
741 double maxUnscaledArrowWidth;
742 double unscaledPlusSignSize;
743 double unscaledPlusSignLineWidth;
744 double outputScalingFactor;
746 unsigned int arrowStyle;
748 unsigned int componentLayout;
749 unsigned int componentLayoutDirection;
751 unsigned int agentAlignment;
752 unsigned int agentLayout;
753 unsigned int agentLayoutDirection;
757 bool plusSignsVisible;
758 bool reactionChanged;
759 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:589
~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 used font metrics object.
void setReaction(const Chem::Reaction *rxn)
Specifies the chemical reaction to visualize.
void setFontMetrics(FontMetrics *font_metrics)
Specifies the font metrics object used for text-size calculations.
void getModelBounds(Rectangle2D &bounds)
Computes the axis-aligned bounding rectangle that contains the rendered reaction model.
ReactionView2D(const Chem::Reaction *rxn=0)
Constructs and initializes a ReactionView2D instance for the visualization of the chemical reaction s...
void render(Renderer2D &renderer)
Renders the visualized reaction via renderer.
std::shared_ptr< ReactionView2D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated ReactionView2D instances.
Definition: ReactionView2D.hpp:595
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:2932
VectorArray< Vector2D > Vector2DArray
Array storing vectors of type Math::Vector2D.
Definition: VectorArray.hpp:80
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.