29 #ifndef CDPL_VIS_REACTIONVIEW2D_HPP
30 #define CDPL_VIS_REACTIONVIEW2D_HPP
62 class ReactionView2DParameters;
645 void renderGraphicsPrimitives(
Renderer2D&)
const;
649 void initComponentViews();
650 void initComponentBoundsTable();
651 void layoutReaction();
652 void calcOutputTransforms();
653 void initComponentViewViewports();
654 void createPlusSignPrimitives();
655 void createArrowPrimitives();
657 void createStdReactionArrow(
bool);
659 void layoutComponents(
unsigned int, std::size_t, std::size_t);
660 void createPackedComponentLayout(
unsigned int, std::size_t, std::size_t);
661 void createLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
662 void createHLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
663 void createVLinearComponentLayout(
unsigned int, std::size_t, std::size_t);
668 void shiftComponentPositions(std::size_t, std::size_t,
const Math::Vector2D&);
669 void shiftPlusSignPositions(std::size_t, std::size_t,
const Math::Vector2D&);
671 void calcArrowDimensions();
672 void calcPlusSignDimensions();
674 void freeComponentViews();
675 void freeGraphicsPrimitives();
677 void initArrowStyle();
678 void initArrowLength();
686 void initComponentLayout();
687 void initComponentLayoutDirection();
688 void initComponentMargin();
689 void initComponentVisibility();
690 void initAgentAlignment();
691 void initAgentLayout();
692 void initAgentLayoutDirection();
698 void initPlusSignVisibility();
704 typedef std::vector<StructureView2D*> ComponentViewList;
705 typedef std::vector<const GraphicsPrimitive2D*> GraphicsPrimitiveList;
706 typedef std::map<const Chem::MolecularGraph*, Rectangle2D> ComponentBoundsMap;
711 typedef std::unique_ptr<ReactionView2DParameters> ReactionView2DParametersPtr;
714 ReactionView2DParametersPtr parameters;
716 ComponentViewList componentViews;
717 GraphicsPrimitiveList drawList;
720 ComponentBoundsMap componentBounds;
721 Vector2DArray componentPositions;
722 Vector2DArray plusSignPositions;
724 double unscaledArrowLength;
725 double unscaledArrowHeadLength;
726 double unscaledArrowHeadWidth;
727 double unscaledArrowShaftWidth;
728 double unscaledArrowLineWidth;
729 double maxUnscaledArrowWidth;
730 double unscaledPlusSignSize;
731 double unscaledPlusSignLineWidth;
732 double outputScalingFactor;
734 unsigned int arrowStyle;
736 unsigned int componentLayout;
737 unsigned int componentLayoutDirection;
739 unsigned int agentAlignment;
740 unsigned int agentLayout;
741 unsigned int agentLayoutDirection;
745 bool plusSignsVisible;
746 bool reactionChanged;
747 bool fontMetricsChanged;
Definition of the class CDPL::Vis::Color.
Definition of the class CDPL::Vis::LineSegmentListPrimitive2D.
Definition of the class CDPL::Util::ObjectStack.
Definition of the class CDPL::Vis::PolygonPrimitive2D.
Definition of the class CDPL::Vis::Rectangle2D.
Definition of the class CDPL::Vis::SizeSpecification.
Definition of the class CDPL::Vis::StructureView2D.
Definition of vector data types.
Definition of the 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.
Molecule.
Definition: Molecule.hpp:49
Reaction.
Definition: Reaction.hpp:52
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
A graphics primitive representing a list of disjoint line segments.
Definition: LineSegmentListPrimitive2D.hpp:51
A 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 a font metrics object that will be used to measure the dimension of text labels.
void getModelBounds(Rectangle2D &bounds)
Calculates the 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 s...
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:595
ReactionView2D(const ReactionView2D &)=delete
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:678
The abstract base of classes implementing the 2D visualization of data objects.
Definition: View2D.hpp:59
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
CDPL_VIS_API const SizeSpecification & getArrowHeadLength(const Chem::Reaction &rxn)
CDPL_VIS_API const SizeSpecification & getArrowLineWidth(const Chem::Reaction &rxn)
CDPL_VIS_API const Color & getArrowColor(const Chem::Reaction &rxn)
CDPL_VIS_API const SizeSpecification & getPlusSignLineWidth(const Chem::Reaction &rxn)
CDPL_VIS_API const SizeSpecification & getPlusSignSize(const Chem::Reaction &rxn)
CDPL_VIS_API unsigned int getComponentLayoutDirection(const Chem::Reaction &rxn)
CDPL_VIS_API unsigned int getComponentLayout(const Chem::Reaction &rxn)
CDPL_VIS_API const SizeSpecification & getArrowHeadWidth(const Chem::Reaction &rxn)
CDPL_VIS_API const SizeSpecification & getArrowShaftWidth(const Chem::Reaction &rxn)
CDPL_VIS_API const Color & getPlusSignColor(const Chem::Reaction &rxn)
The namespace of the Chemical Data Processing Library.