COPASI API
4.40.278
|
#include <CLLayoutRenderer.h>
Public Member Functions | |
void | addToSelection (CLGraphicalObject *pObject) |
void | analyse_render_information (double lx, double ly, double rx, double ry) |
void | change_style (const CLGlobalRenderInformation *pRenderInformation, bool defaultStyle=false) |
void | change_style (const CLLocalRenderInformation *pRenderInformation) |
void | clearSelection () |
CLLayoutRenderer (CLayout *pLayout, const CLGlobalRenderInformation *pRenderInformation, const CDataVector< CLGlobalRenderInformation > *pGlobalRenderInformationList, const CModel *pModel, const std::string &baseDir) | |
CLLayoutRenderer (CLayout *pLayout, const CLLocalRenderInformation *pRenderInformation, const CDataVector< CLGlobalRenderInformation > *pGlobalRenderInformationList, const CModel *pModel, const std::string &baseDir) | |
std::pair< double, double > | convert_to_model_space (double x, double y) const |
void | draw_layout () |
double | getAspect () const |
const GLfloat * | getFogColor () const |
GLfloat | getFogDensity () const |
const GLfloat * | getHighlightColor () const |
std::set< const CLGraphicalObject * > & | getHighlightedObjects () |
const std::set< const CLGraphicalObject * > & | getHighlightedObjects () const |
bool | getHighlightFlag () const |
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > | getObjectsAt (double x, double y) |
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > | getObjectsAtViewportPosition (unsigned int x, unsigned int y) |
std::vector< CLGraphicalObject * > | getObjectsInBoundingBox (double lx, double ly, double rx, double ry, bool partial=true) |
std::set< CLGraphicalObject * > & | getSelection () |
const std::set< CLGraphicalObject * > & | getSelection () const |
CLBoundingBox * | getSelectionBox () |
const CLBoundingBox * | getSelectionBox () const |
double | getZoomFactor () const |
bool | isSelected (const CLGraphicalObject *) const |
bool | isSetDeduceSpeciesReferenceRoles () const |
void | move_curve_object (CLCurve *pCurve, double dx, double dy, bool leaveStartPoint=false, bool leaveEndpoint=false) |
void | move_graphical_object (CLGraphicalObject *pObject, double dx, double dy) |
void | move_reaction_glyph (CLReactionGlyph *pRG, double dx, double dy, bool moveSelectedAssociation=false) |
void | move_selection (double dx, double dy, bool moveAssociated=true) |
void | move_species_glyph (CLMetabGlyph *pSG, double dx, double dy, bool moveSelectedAssociations=false) |
void | move_species_reference_glyph (CLMetabReferenceGlyph *pSRG, double dx, double dy) |
void | move_text_glyph (CLTextGlyph *pTG, double dx, double dy) |
void | removeFromSelection (CLGraphicalObject *pObject) |
void | resize (GLsizei w, GLsizei h) |
void | set_font_renderer (CLFontRendererBase *pFontRenderer) |
void | setAspect (double aspect) |
void | setDeduceSpeciesReferenceRoles (bool deduce) |
void | setFogColor (const GLfloat c[4]) |
void | setFogDensity (GLfloat dens) |
void | setHighlightColor (const GLfloat c[4]) |
void | setHighlightedObjects (const std::set< const CLGraphicalObject * > &highlightedObjects) |
void | setHighlightFlag (bool flag) |
void | setImageTexturizer (CLImageTexturizer *pTexturizer) |
void | setSelectionBox (const CLBoundingBox *pBox) |
void | setX (double x) |
void | setY (double y) |
void | setZoomFactor (double zoomFactor) |
void | toggleHighlightFlag () |
~CLLayoutRenderer () | |
Static Public Member Functions | |
static double | distance (const CLPoint &p1, const CLPoint &p2) |
static CLBoundingBox * | getCurveBoundingBox (const CLCurve *pCurve) |
static bool | is_curve_segment_visible (const CLLineSegment &segment, double lx, double ly, double rx, double ry, bool partial) |
static bool | is_curve_visible (const CLCurve &curve, double lx, double ly, double rx, double ry, bool partial) |
static CLCurve * | revert_curve (const CLCurve *pCurve) |
Protected Member Functions | |
void | clear_cached_data () |
void | create_gradient_texture (unsigned int size, GLubyte *pData, const CLGradientBase *pGradient, double z_value=0.0) |
void | create_linear_gradient_texture (unsigned int size, GLubyte *pData, const CLLinearGradient *pGradient, double z_value) |
void | create_radial_gradient_texture (unsigned int size, GLubyte *pData, const CLRadialGradient *pGradient, double z_value) |
void | draw_cap (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double stroke_width) |
void | draw_curve (const CLCurve *pCurve, bool drawBasepoints=false) |
void | draw_curve (const CLRenderCurve *pCurve, const CLBoundingBox *pBB) |
void | draw_datapoints (GLdouble *pData, size_t numPoints, const CLBoundingBox *pBB, bool doTesselation=false, float xOffset=0.0, float yOffset=0.0, float zOffset=0.0) |
void | draw_ellipse (const CLEllipse *pEllipse, const CLBoundingBox *pBB) |
void | draw_group (const CLGroup *pGroup, const CLBoundingBox *pBB) |
void | draw_image (const CLImage *pImage, const CLBoundingBox *pBB) |
void | draw_line (size_t numPoints, GLdouble *pData) |
void | draw_line_segment (double x1, double y1, double z1, double x2, double y2, double z2, double line_width, bool texture=false, double s1=0.0, double s2=0.0) |
void | draw_object (const CLStyle *pStyle, const CLBoundingBox *pBB) |
void | draw_polygon (const CLPolygon *pPolygon, const CLBoundingBox *pBB) |
void | draw_rectangle (const CLRectangle *pRectangle, const CLBoundingBox *pBB) |
void | draw_selection_box () const |
void | draw_text (const CLStyle *pStyle, const CLBoundingBox *pBB, const CLTextTextureSpec *pTexture) |
void | draw_text (const CLText *pText, const CLBoundingBox *pBB) |
void | draw_text (const CLTextTextureSpec *pTexture, double x, double y, double z, const CLBoundingBox *pBB) |
void | initialize_gl_extension_functions () |
void | map_arrow_head (const CLPoint &p, const CLPoint &v, const std::string &headId) |
void | map_gradient_color (double rel_distance, const CLGradientBase *pGradient, GLubyte *pData) |
void | resolve_color (const std::string &color, GLubyte array[4]) |
void | restore_current_attributes () |
void | save_current_attributes () |
void | segment_data (double length, double ratio, size_t numPoints, GLdouble *pData, std::vector< simple_point > &v) |
void | update_associations () |
void | update_colors (const CLGradientBase *pGradient) |
void | update_drawables (double lx, double ly, double rx, double ry) |
void | update_style_information () |
void | update_textures_and_colors () |
void | update_textures_and_colors (const CLGroup *pGroup, double maxDimension, double height, const std::string &parentFill="", CLFontSpec parentFontSpec=CLFontSpec()) |
Static Protected Member Functions | |
static void | calculate_cubicbezier (double sx, double sy, double sz, double p1x, double p1y, double p1z, double p2x, double p2y, double p2z, double ex, double ey, double ez, unsigned int numPoints, GLdouble *pData) |
static CLPoint * | calculate_intersection (double p1x, double p1y, double p1z, double sx, double sy, double sz, double p2x, double p2y, double p2z, double tx, double ty, double tz) |
static std::pair< double, double > | calculate_intersection_point_2d (double p1x, double p1y, double sx, double sy, double p2x, double p2y, double tx, double ty) |
static void | COMBINE_CALLBACK (GLdouble coords[3], GLdouble **, GLfloat *, GLdouble **dataOut) |
static void | COMBINE_CALLBACK_GRADIENT (GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut) |
static const CLPoint | convert_to_absolute (const CLRenderPoint *pRenderPoint, const CLBoundingBox *pBB) |
static void | createGLMatrix (const double *const matrix, GLdouble *glMatrix) |
static CLLineStippleTexture * | createLineStippleTexture (const std::vector< unsigned int > &dasharray) |
static double | distancePointLineSegment (double x, double y, double lx1, double ly1, double lx2, double ly2) |
static void | drawSelectionBox (double x, double y, double width, double height, bool drawHandles=false) |
static void | extract_1d_attributes (const CLGraphicalPrimitive1D *pObject, CLGroupAttributes *attributes) |
static void | extract_2d_attributes (const CLGraphicalPrimitive2D *pObject, CLGroupAttributes *attributes) |
template<typename T > | |
static void | extract_arrowhead_information (const T *pObject, CLGroupAttributes *attributes) |
static void | extract_group_attributes (const CLGroup *pGroup, CLGroupAttributes *attributes) |
static void | extract_group_attributes (const CLStyle *pStyle, CLGroupAttributes *attributes) |
template<typename T > | |
static void | extract_text_attributes (const T *pObject, CLGroupAttributes *attributes) |
static void | extract_transformation_attributes (const CLTransformation *pObject, CLGroupAttributes *attributes) |
static CLFontSpec | getFontSpec (const CLGroup *pGroup, double boxHeight, const CLFontSpec &parentFontSpec=CLFontSpec()) |
static CLFontSpec | getFontSpec (const CLText *pText, double boxHeight, const CLFontSpec &parentFontSpec=CLFontSpec()) |
static bool | isSegmentHit (const CLLineSegment *pLS, double x, double y, double toleranceRadius) |
static const std::string | resolve_text (const CLTextGlyph *pTextGlyph) |
static bool | segments_intersect_2d (double p1x1, double p1y1, double p1x2, double p1y2, double p2x1, double p2y1, double p2x2, double p2y2) |
static void | TESS_ERROR (GLenum error) |
static void | VERTEX_CALLBACK_GRADIENT (GLvoid *vertex) |
Static Protected Attributes | |
static const double | ALMOST_ZERO = 1e-12 |
static const unsigned int | GRADIENT_TEXTURE_SIZE_LIMIT = 512 |
static const unsigned int | NUM_BEZIER_POINTS = 20 |
static const unsigned int | NUM_CIRCLE_SEGMENTS = 60 |
static const unsigned int | NUM_CORNER_SEGMENTS = 10 |
static const double | SELECTION_FRAME_WIDTH = 3.0 |
CLLayoutRenderer::CLLayoutRenderer | ( | CLayout * | pLayout, |
const CLGlobalRenderInformation * | pRenderInformation, | ||
const CDataVector< CLGlobalRenderInformation > * | pGlobalRenderInformationList, | ||
const CModel * | pModel, | ||
const std::string & | baseDir | ||
) |
constructor for global render information
References change_style(), mFogColor, and mHighlightColor.
CLLayoutRenderer::CLLayoutRenderer | ( | CLayout * | pLayout, |
const CLLocalRenderInformation * | pRenderInformation, | ||
const CDataVector< CLGlobalRenderInformation > * | pGlobalRenderInformationList, | ||
const CModel * | pModel, | ||
const std::string & | baseDir | ||
) |
constructor for local render information
References change_style(), initialize_gl_extension_functions(), mFogColor, and mHighlightColor.
CLLayoutRenderer::~CLLayoutRenderer | ( | ) |
destructor.
References clear_cached_data(), mpFontRenderer, mpResolver, and mpSelectionBox.
void CLLayoutRenderer::addToSelection | ( | CLGraphicalObject * | pObject | ) |
This method adds a graphical object to the set of selected objects.
References draw_layout(), and mSelection.
void CLLayoutRenderer::analyse_render_information | ( | double | lx, |
double | ly, | ||
double | rx, | ||
double | ry | ||
) |
Analyses the render information and creates some of the textures. First it determines which object are drawn based on the viewport coordinates that are passed in. Next it resolves the styles for all the objects that are to be drawn and it determines the size of the textures. Last it creates all textures.
References ALMOST_ZERO, update_drawables(), update_style_information(), and update_textures_and_colors().
Referenced by change_style(), resize(), and setDeduceSpeciesReferenceRoles().
|
staticprotected |
Calculates the points for a cubic bezier curve. The algorithm calculates numPoints and stores them in pData. pData has to be an array with enough space for numPoints*3 GLfloat items.
Referenced by draw_curve(), draw_polygon(), is_curve_segment_visible(), and isSegmentHit().
|
staticprotected |
calculates the intersection point of two lines. The caller has to delete the returned point object.
References ALMOST_ZERO, CLPoint::getX(), CLPoint::getY(), and CLPoint::getZ().
Referenced by draw_cap().
|
staticprotected |
Calculates the intersection point between two lines in 2D. The intersection point is returned. If the lines are parallel, a point with two NaN values is returned. All numbers <= ALMOST_ZERO are considered to be 0.
References ALMOST_ZERO.
Referenced by segments_intersect_2d().
void CLLayoutRenderer::change_style | ( | const CLGlobalRenderInformation * | pRenderInformation, |
bool | defaultStyle = false |
||
) |
This method replaces the current style with the given global render information.
References analyse_render_information(), clear_cached_data(), mDeduceSpeciesReferenceRoles, mH, mpFontRenderer, mpGlobalRenderInfoList, mpResolver, mSpeciesReferencesWithDeducedRole, mW, mX, mY, mZoomFactor, CLRenderResolver::setDeducedObjectRoles(), and setDeduceSpeciesReferenceRoles().
Referenced by CLLayoutRenderer().
void CLLayoutRenderer::change_style | ( | const CLLocalRenderInformation * | pRenderInformation | ) |
This method replaces the current style with the given glocal render information.
References analyse_render_information(), clear_cached_data(), CLayout::getListOfLocalRenderInformationObjects(), mDeduceSpeciesReferenceRoles, mH, mpFontRenderer, mpLayout, mpResolver, mSpeciesReferencesWithDeducedRole, mW, mX, mY, mZoomFactor, and CLRenderResolver::setDeducedObjectRoles().
|
protected |
Removes all entries from all cache maps and frees the memory for the textures.
References mColorMap, mDrawables, mFontTextureMap, mGradientMap, mImageMap, mLineEndingMap, mLinestippleMap, mStyleMap, mTextGlyphMap, and mTextMap.
Referenced by change_style(), setDeduceSpeciesReferenceRoles(), and ~CLLayoutRenderer().
void CLLayoutRenderer::clearSelection | ( | ) |
This method clears the selection.
References mSelection.
|
staticprotected |
This static method is used as a callback for the GLU tesselator. It is needed for polygons that intersect which itself and the tesselator has to create a new vertex at the intersection.
Referenced by draw_datapoints().
|
staticprotected |
This static method is used as a callback for the GLU tesselator. It is needed for polygons that intersect which itself and the tesselator has to create a new vertex at the intersection.
Referenced by draw_datapoints().
|
staticprotected |
Converts a given RenderPoint which can have relative values into a layout Point with only absolute values.
Converts a given CLRenderPoint which can have relative values into a layout CLPoint with only absolute values. Even the absolute values of the point which are relative to the bounding box are translated into absolute coordinates.
References CLRelAbsVector::getAbsoluteValue(), CLDimensions::getDepth(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLBoundingBox::getPosition(), CLRelAbsVector::getRelativeValue(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), CLRenderPoint::x(), CLRenderPoint::y(), and CLRenderPoint::z().
Referenced by draw_curve(), draw_image(), draw_polygon(), and draw_rectangle().
std::pair< double, double > CLLayoutRenderer::convert_to_model_space | ( | double | x, |
double | y | ||
) | const |
converts the given coordinates from viewport space into model space.
References mX, mY, and mZoomFactor.
Referenced by getObjectsAtViewportPosition().
|
protected |
This method calculates a texture for a given gradient definition and a given size. The data object has to be a vector that can store RGBA values for a rectangle of the given size. The memory has to be allocated before calling the method. The scale specifies by how much the original box has been scaled.
References create_linear_gradient_texture(), and create_radial_gradient_texture().
Referenced by update_textures_and_colors().
|
protected |
This method calculates a texture for a given linear gradient definition and a given size. The data object has to be a vector that can store RGBA values for a rectangle of the given size. The memory has to be allocated before calling the method. The scale specifies by how much the original box has been scaled.
References ALMOST_ZERO, CLGradientStops::color(), CLRelAbsVector::getAbsoluteValue(), CLRelAbsVector::getRelativeValue(), CLLinearGradient::getXPoint1(), CLLinearGradient::getXPoint2(), CLLinearGradient::getYPoint1(), CLLinearGradient::getYPoint2(), CLLinearGradient::getZPoint1(), CLLinearGradient::getZPoint2(), CLRGBAColor::mA, CLRGBAColor::mB, mColorMap, CLRGBAColor::mG, CLRGBAColor::mR, mZoomFactor, and CLGradientStops::update_color().
Referenced by create_gradient_texture().
|
protected |
This method calculates a texture for a given radial gradient definition and a given size. The data object has to be a vector that can store RGBA values for a rectangle of the given size. The memory has to be allocated before calling the method. The scale specifies by how much the original box has been scaled.
References ALMOST_ZERO, CLGradientStops::color(), CLRelAbsVector::getAbsoluteValue(), CLRadialGradient::getCenterX(), CLRadialGradient::getCenterY(), CLRadialGradient::getFocalPointX(), CLRadialGradient::getFocalPointY(), CLRadialGradient::getRadius(), CLRelAbsVector::getRelativeValue(), CLRGBAColor::mA, CLRGBAColor::mB, mColorMap, CLRGBAColor::mG, CLRGBAColor::mR, mZoomFactor, and CLGradientStops::update_color().
Referenced by create_gradient_texture().
|
staticprotected |
Referenced by draw_curve(), draw_datapoints(), draw_group(), draw_image(), and draw_text().
|
staticprotected |
Creates a 1D texture for the line stippling. The caller is responsible for deleting the returned object. If the dasharray does not contain a valid stipple pattern NULL is returned.
Referenced by update_textures_and_colors().
calculates the distance between two layout points.
References CLPoint::getX(), and CLPoint::getY().
Referenced by distancePointLineSegment(), isSegmentHit(), and update_associations().
|
staticprotected |
Calculates the distance between a point and a line segment. It tries to calculate the intersection point of the line and another line perpendicular to the first line through the given point. If this intersection point is on the line segment, the result is the same as the distance between the two lines, otherwise the distance is the distance of the given point to the closest endpoint of the segment.
References distance().
Referenced by isSegmentHit().
|
protected |
Routine to draw the caps between two line segments. The method takes the three points that make the two line segments and the width of the line.
References ALMOST_ZERO, calculate_intersection(), CLPoint::getX(), CLPoint::getY(), and CLPoint::getZ().
Referenced by draw_datapoints(), and draw_line().
|
protected |
Method that draws a curve from the layout extension. All the other parameter like color, linewidth etc. have to be set before.
References calculate_cubicbezier(), createGLMatrix(), draw_line(), CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLTransformation::getIdentityMatrix(), CLCurve::getNumCurveSegments(), CLCurve::getSegmentAt(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), CLLineSegment::isBezier(), CLRGBAColor::mA, map_arrow_head(), CLRGBAColor::mB, mColorMap, mCurrentAttributes, CLGroupAttributes::mEndHead, CLRGBAColor::mG, CLGroupAttributes::mpTransform, CLRGBAColor::mR, CLGroupAttributes::mStartHead, CLGroupAttributes::mStroke, CLGroupAttributes::mStrokeWidth, simple_point::mX, CLGroupAttributes::mX, simple_point::mY, simple_point::mZ, NUM_BEZIER_POINTS, and NUM_CIRCLE_SEGMENTS.
Referenced by draw_group(), and draw_layout().
|
protected |
Method that draws a curve from the render extension. All the other parameter like color, linewidth etc. have to be set before.
References CLRenderCubicBezier::basePoint1_X(), CLRenderCubicBezier::basePoint1_Y(), CLRenderCubicBezier::basePoint1_Z(), CLRenderCubicBezier::basePoint2_X(), CLRenderCubicBezier::basePoint2_Y(), CLRenderCubicBezier::basePoint2_Z(), calculate_cubicbezier(), convert_to_absolute(), createGLMatrix(), draw_line(), extract_1d_attributes(), extract_arrowhead_information(), CLRenderCurve::getCurveElement(), CLTransformation::getIdentityMatrix(), CLRenderCurve::getNumElements(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), CLRGBAColor::mA, map_arrow_head(), CLRGBAColor::mB, mColorMap, mCurrentAttributes, CLGroupAttributes::mEndHead, CLRGBAColor::mG, CLGroupAttributes::mpTransform, CLRGBAColor::mR, CLGroupAttributes::mStartHead, CLGroupAttributes::mStroke, simple_point::mX, CLGroupAttributes::mX, simple_point::mY, simple_point::mZ, NUM_BEZIER_POINTS, restore_current_attributes(), save_current_attributes(), CLRenderPoint::x(), CLRenderPoint::y(), and CLRenderPoint::z().
|
protected |
Draw a set of datapoints with the current attributes using the given bounding box.
Method to draw a render polygon from a set of datapoints
References COMBINE_CALLBACK(), COMBINE_CALLBACK_GRADIENT(), createGLMatrix(), draw_cap(), draw_line(), CLGraphicalPrimitive2D::EVENODD, CCopasiMessage::EXCEPTION, CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLBoundingBox::getPosition(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), CLGraphicalPrimitive2D::INHERIT, CLRGBAColor::mA, CLRGBAColor::mB, mColorMap, mCurrentAttributes, CLGroupAttributes::mFill, CLGroupAttributes::mFillRule, CLRGBAColor::mG, mGradientMap, CLGroupAttributes::mpTransform, CLRGBAColor::mR, CLGroupAttributes::mStroke, CLGroupAttributes::mStrokeWidth, CLTextureSpec::mTextureName, CLGroupAttributes::mX, CLGraphicalPrimitive2D::NONZERO, TESS_ERROR(), CLGraphicalPrimitive2D::UNSET, and VERTEX_CALLBACK_GRADIENT().
Referenced by draw_ellipse(), draw_polygon(), and draw_rectangle().
|
protected |
Method to draw a render ellipse object.
References draw_datapoints(), extract_2d_attributes(), CLRelAbsVector::getAbsoluteValue(), CLEllipse::getCX(), CLEllipse::getCY(), CLEllipse::getCZ(), CLDimensions::getDepth(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLBoundingBox::getPosition(), CLRelAbsVector::getRelativeValue(), CLEllipse::getRX(), CLEllipse::getRY(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), mCurrentAttributes, NUM_CIRCLE_SEGMENTS, restore_current_attributes(), and save_current_attributes().
Referenced by draw_group().
|
protected |
Method to draw an arbitrary object specified by it's bounding box and the style with which it should be drawn.
References createGLMatrix(), draw_curve(), draw_ellipse(), draw_image(), draw_polygon(), draw_rectangle(), draw_text(), extract_group_attributes(), CLBoundingBox::getDimensions(), CLGroup::getElement(), CLDimensions::getHeight(), CLGroup::getNumElements(), CLBoundingBox::getPosition(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), mCurrentAttributes, CLGroupAttributes::mHeight, CLGroupAttributes::mpTransform, CLGroupAttributes::mWidth, CLGroupAttributes::mX, CLGroupAttributes::mY, CLGroupAttributes::mZ, restore_current_attributes(), and save_current_attributes().
Referenced by draw_object(), and map_arrow_head().
|
protected |
Method to draw a render image object.
References convert_to_absolute(), createGLMatrix(), extract_transformation_attributes(), CLRelAbsVector::getAbsoluteValue(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLImage::getHeight(), CLImage::getImageReference(), CLRelAbsVector::getRelativeValue(), CLDimensions::getWidth(), CLImage::getWidth(), CLImage::getX(), CLPoint::getX(), CLImage::getY(), CLPoint::getY(), CLPoint::getZ(), CLImage::isSetImageReference(), mBaseDir, mCurrentAttributes, mImageMap, mpImageTexturizer, CLGroupAttributes::mpTransform, CLTextureSpec::mTextureName, CLGroupAttributes::mX, restore_current_attributes(), and save_current_attributes().
Referenced by draw_group().
void CLLayoutRenderer::draw_layout | ( | ) |
Method to draw a given layout with a given render resolver.
References draw_curve(), draw_object(), draw_selection_box(), draw_text(), drawSelectionBox(), extract_group_attributes(), CLColorDefinition::getAlpha(), CLRenderResolver::getBackgroundColor(), CLColorDefinition::getBlue(), CLGraphicalObject::getBoundingBox(), CLGlyphWithCurve::getCurve(), getCurveBoundingBox(), CLayout::getDimensions(), CLBoundingBox::getDimensions(), CLColorDefinition::getGreen(), CLDimensions::getHeight(), CLGraphicalObject::getModelObject(), CLCurve::getNumCurveSegments(), CDataObject::getObjectParent(), CLBoundingBox::getPosition(), CLColorDefinition::getRed(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), GL_FOG_COORD, GL_FOG_COORD_SRC, initialize_gl_extension_functions(), mCurrentAttributes, mDrawables, mFogColor, mFogDensity, mGLFunctionsInitialized, CLGroupAttributes::mHeight, mHighlight, mHighlightColor, mHighlightedObjects, mpGlFogCoordfEXT, mpLayout, mpResolver, mSelection, CLGroupAttributes::mStroke, CLGroupAttributes::mStrokeWidth, mStyleMap, mTextGlyphMap, CLGroupAttributes::mWidth, CLGroupAttributes::mX, CLGroupAttributes::mY, CLGroupAttributes::mZ, restore_current_attributes(), save_current_attributes(), and CLBoundingBox::setPosition().
Referenced by addToSelection(), and removeFromSelection().
|
protected |
Method to draw a line made up of a set of points.
References draw_cap(), draw_line_segment(), mCurrentAttributes, mLinestippleMap, CLLineStippleTexture::mPatternLength, CLGroupAttributes::mStrokeDasharray, CLGroupAttributes::mStrokeWidth, CLLineStippleTexture::mTextureLength, CLLineStippleTexture::mTextureName, and segment_data().
Referenced by draw_curve(), and draw_datapoints().
|
protected |
Method that draws a line with the given start and end points. All the other parameter like color, linewidth etc. have to be set before.
References ALMOST_ZERO.
Referenced by draw_line().
|
protected |
Method to draw an arbitrary object specified by it's bounding box and the style with which it should be drawn.
References draw_group(), and CLStyle::getGroup().
Referenced by draw_layout().
|
protected |
Method to draw a render polygon object.
References CLRenderCubicBezier::basePoint1_X(), CLRenderCubicBezier::basePoint1_Y(), CLRenderCubicBezier::basePoint1_Z(), CLRenderCubicBezier::basePoint2_X(), CLRenderCubicBezier::basePoint2_Y(), CLRenderCubicBezier::basePoint2_Z(), calculate_cubicbezier(), convert_to_absolute(), draw_datapoints(), extract_2d_attributes(), CLPolygon::getElement(), CLPolygon::getNumElements(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), mCurrentAttributes, simple_point::mX, simple_point::mY, simple_point::mZ, NUM_BEZIER_POINTS, restore_current_attributes(), save_current_attributes(), CLRenderPoint::x(), CLRenderPoint::y(), and CLRenderPoint::z().
Referenced by draw_group().
|
protected |
Method to draw a render rectangle object.
References convert_to_absolute(), draw_datapoints(), extract_2d_attributes(), CLRelAbsVector::getAbsoluteValue(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLRectangle::getHeight(), CLRectangle::getRadiusX(), CLRectangle::getRadiusY(), CLRelAbsVector::getRelativeValue(), CLDimensions::getWidth(), CLRectangle::getWidth(), CLPoint::getX(), CLRectangle::getX(), CLPoint::getY(), CLRectangle::getY(), CLPoint::getZ(), CLRectangle::getZ(), mCurrentAttributes, NUM_CORNER_SEGMENTS, restore_current_attributes(), and save_current_attributes().
Referenced by draw_group().
|
protected |
draws the selection box if there is one
References CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLBoundingBox::getPosition(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), mH, mpSelectionBox, mW, mX, mY, and mZoomFactor.
Referenced by draw_layout().
|
protected |
Method to draw a text object specified by it's bounding box and the style with which it should be drawn as well as the actual string.
References CLText::ANCHOR_BOTTOM, CLText::ANCHOR_END, CLText::ANCHOR_MIDDLE, extract_1d_attributes(), extract_text_attributes(), CLBoundingBox::getDimensions(), CLStyle::getGroup(), CLDimensions::getHeight(), CLDimensions::getWidth(), mCurrentAttributes, CLGroupAttributes::mStroke, CLGroupAttributes::mTextAnchor, CLGroupAttributes::mVTextAnchor, restore_current_attributes(), and save_current_attributes().
Referenced by draw_group(), draw_layout(), and draw_text().
|
protected |
Method to draw a render text object.
References draw_text(), extract_1d_attributes(), extract_text_attributes(), CLRelAbsVector::getAbsoluteValue(), CLDimensions::getDepth(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLRelAbsVector::getRelativeValue(), CLDimensions::getWidth(), CLText::getX(), CLText::getY(), CLText::getZ(), CLText::isSetText(), mCurrentAttributes, mTextMap, restore_current_attributes(), and save_current_attributes().
|
protected |
Method to draw a string at the given position within the given bounding box.
pTexture->mScale
pTexture->mScale
References CLText::ANCHOR_BOTTOM, CLText::ANCHOR_END, CLText::ANCHOR_MIDDLE, createGLMatrix(), CLBoundingBox::getPosition(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), CLRGBAColor::mA, CLRGBAColor::mB, mColorMap, mCurrentAttributes, CLRGBAColor::mG, CLGroupAttributes::mpTransform, CLRGBAColor::mR, CLTextTextureSpec::mScale, CLGroupAttributes::mStroke, CLGroupAttributes::mTextAnchor, CLTextureSpec::mTextHeight, CLTextureSpec::mTextureHeight, CLTextureSpec::mTextureName, CLTextureSpec::mTextureWidth, CLTextureSpec::mTextWidth, CLGroupAttributes::mVTextAnchor, CLGroupAttributes::mX, and mZoomFactor.
|
staticprotected |
Draw the selection frame around an graphical objects bounding object box. If drawHandles is true, resize handles are drawn as well, else only the box is drawn. If the curve is given, the basepoints of the curve are also drawn as small circles.
References SELECTION_FRAME_WIDTH.
Referenced by draw_layout().
|
staticprotected |
Extracts the attributes from the given one dimensional object.
References extract_transformation_attributes(), CLGraphicalPrimitive1D::getDashArray(), CLGraphicalPrimitive1D::getStroke(), CLGraphicalPrimitive1D::getStrokeWidth(), CLGraphicalPrimitive1D::isSetDashArray(), CLGraphicalPrimitive1D::isSetStroke(), CLGraphicalPrimitive1D::isSetStrokeWidth(), CLGroupAttributes::mStroke, CLGroupAttributes::mStrokeDasharray, and CLGroupAttributes::mStrokeWidth.
Referenced by draw_curve(), draw_text(), and extract_2d_attributes().
|
staticprotected |
Extracts the attributes from the given two dimensional object.
References extract_1d_attributes(), CLGraphicalPrimitive2D::getFillColor(), CLGraphicalPrimitive2D::getFillRule(), CLGraphicalPrimitive2D::isSetFill(), CLGraphicalPrimitive2D::isSetFillRule(), CLGroupAttributes::mFill, and CLGroupAttributes::mFillRule.
Referenced by draw_ellipse(), draw_polygon(), draw_rectangle(), and extract_group_attributes().
|
inlinestaticprotected |
Extracts the attributes from the given object with arrow head information. This template function can be used for group and curve elements.
References CLGroupAttributes::mEndHead, and CLGroupAttributes::mStartHead.
Referenced by draw_curve(), and extract_group_attributes().
|
staticprotected |
Extracts the group attributes from the given group.
References extract_2d_attributes(), extract_arrowhead_information(), and extract_text_attributes().
|
staticprotected |
Extracts the group attributes from the outermost group of a style.
References CLStyle::getGroup().
Referenced by draw_group(), and draw_layout().
|
inlinestaticprotected |
Extracts the attributes from the given object with text attribute information. This template function can be used for group and text elements.
References CLGroupAttributes::mFontFamily, CLGroupAttributes::mFontSize, CLGroupAttributes::mFontStyle, CLGroupAttributes::mFontWeight, CLGroupAttributes::mTextAnchor, and CLGroupAttributes::mVTextAnchor.
Referenced by draw_text(), and extract_group_attributes().
|
staticprotected |
Extracts the attributes from the given transformation object.
References CLTransformation::getMatrix(), CLTransformation::isSetMatrix(), and CLGroupAttributes::mpTransform.
Referenced by draw_image(), and extract_1d_attributes().
double CLLayoutRenderer::getAspect | ( | ) | const |
Returns the current aspect.
References mAspect.
|
static |
Calculates the bounding box of the curve by looking at all the basepoints. The returned boundingbox object has to be deleted by the caller.
References CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLCurve::getNumCurveSegments(), CLCurve::getSegmentAt(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), CLLineSegment::isBezier(), and max.
Referenced by draw_layout().
const GLfloat * CLLayoutRenderer::getFogColor | ( | ) | const |
Returns a const pointer to the fog color. The array has a size of 4 elements.
References mFogColor.
GLfloat CLLayoutRenderer::getFogDensity | ( | ) | const |
Returns the current fog density.
References mFogDensity.
|
staticprotected |
This method creates a FontSpec object from the font attributes in the given group. The height that is passed to the method is the height for the bounding box and it used to calculate the font size if it has a relative component.
References CLRelAbsVector::getAbsoluteValue(), CLGroup::getFontFamily(), CLGroup::getFontSize(), CLGroup::getFontStyle(), CLGroup::getFontWeight(), CLRelAbsVector::getRelativeValue(), CLGroup::isSetFontFamily(), CLGroup::isSetFontSize(), CLGroup::isSetFontStyle(), CLGroup::isSetFontWeight(), CLFontSpec::mFamily, CLFontSpec::mSize, CLFontSpec::mStyle, and CLFontSpec::mWeight.
Referenced by update_textures_and_colors().
|
staticprotected |
This method creates a FontSpec object from the font attributes in the given text element. The height that is passed to the method is the height for the bounding box and it used to calculate the font size if it has a relative component.
References CLRelAbsVector::getAbsoluteValue(), CLText::getFontFamily(), CLText::getFontSize(), CLText::getFontStyle(), CLText::getFontWeight(), CLRelAbsVector::getRelativeValue(), CLText::isSetFontFamily(), CLText::isSetFontSize(), CLText::isSetFontStyle(), CLText::isSetFontWeight(), CLFontSpec::mFamily, CLFontSpec::mSize, CLFontSpec::mStyle, and CLFontSpec::mWeight.
const GLfloat * CLLayoutRenderer::getHighlightColor | ( | ) | const |
Returns a const pointer to the highlight color. The array has a size of 4 elements.
References mHighlightColor.
std::set< const CLGraphicalObject * > & CLLayoutRenderer::getHighlightedObjects | ( | ) |
Returns a reference to the set of highlighted model objects.
References mHighlightedObjects.
const std::set< const CLGraphicalObject * > & CLLayoutRenderer::getHighlightedObjects | ( | ) | const |
Returns a const reference to the set of highlighted model objects.
References mHighlightedObjects.
bool CLLayoutRenderer::getHighlightFlag | ( | ) | const |
Returns the highlight flag.
References mHighlight.
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > CLLayoutRenderer::getObjectsAt | ( | double | x, |
double | y | ||
) |
This method returns all objects at the given 2D model coordinates. The depth value is ignored.
References CLGraphicalObject::getBoundingBox(), CLGlyphWithCurve::getCurve(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLayout::getListOfCompartmentGlyphs(), CLayout::getListOfGeneralGlyphs(), CLayout::getListOfMetaboliteGlyphs(), CLReactionGlyph::getListOfMetabReferenceGlyphs(), CLayout::getListOfReactionGlyphs(), CLGeneralGlyph::getListOfReferenceGlyphs(), CLayout::getListOfTextGlyphs(), CLCurve::getNumCurveSegments(), CLBoundingBox::getPosition(), CLCurve::getSegmentAt(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), isSegmentHit(), mDrawables, mH, mpLayout, mW, mX, mY, mZoomFactor, and CDataVector< CType >::size().
Referenced by getObjectsAtViewportPosition().
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > CLLayoutRenderer::getObjectsAtViewportPosition | ( | unsigned int | x, |
unsigned int | y | ||
) |
This method returns all objects at the given 2D screen coordinates. The depth value is ignored.
References convert_to_model_space(), and getObjectsAt().
std::vector< CLGraphicalObject * > CLLayoutRenderer::getObjectsInBoundingBox | ( | double | lx, |
double | ly, | ||
double | rx, | ||
double | ry, | ||
bool | partial = true |
||
) |
Returns all objects that are within a given bounding box. The bounding box is determined by lx and ly which are the lower x and lower y values of the box and rx, ry which are the higher x and y values of the box. If partial is true, objects that are only parially included in the box are returned. If it is set to false, an object has to be completely within the bounding box to be returned.
Returns all objects that are within a given bounding box.
References CLGraphicalObject::getBoundingBox(), CLGlyphWithCurve::getCurve(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), CLayout::getListOfCompartmentGlyphs(), CLayout::getListOfGeneralGlyphs(), CLayout::getListOfMetaboliteGlyphs(), CLReactionGlyph::getListOfMetabReferenceGlyphs(), CLayout::getListOfReactionGlyphs(), CLGeneralGlyph::getListOfReferenceGlyphs(), CLGeneralGlyph::getListOfSubglyphs(), CLayout::getListOfTextGlyphs(), CLCurve::getNumCurveSegments(), CLBoundingBox::getPosition(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), is_curve_visible(), mpLayout, and CDataVector< CType >::size().
Referenced by update_drawables().
std::set< CLGraphicalObject * > & CLLayoutRenderer::getSelection | ( | ) |
This method returns a reference to the set of selected objects.
References mSelection.
const std::set< CLGraphicalObject * > & CLLayoutRenderer::getSelection | ( | ) | const |
This method returns a const reference to the set of selected objects.
References mSelection.
CLBoundingBox * CLLayoutRenderer::getSelectionBox | ( | ) |
returns a point to the current selection box.
References mpSelectionBox.
const CLBoundingBox * CLLayoutRenderer::getSelectionBox | ( | ) | const |
returns a const point to the current selection box.
References mpSelectionBox.
double CLLayoutRenderer::getZoomFactor | ( | ) | const |
Returns the current zoom factor.
References mZoomFactor.
|
protected |
The glFogCoordf function is part of OpenGL 1.4 and may not be available on all implementations, so we need to query for this dynamically.
On non apple systems, we need to get the pointers to extension functions.
References mGLFunctionsInitialized, and mpGlFogCoordfEXT.
Referenced by CLLayoutRenderer(), and draw_layout().
|
static |
Checks if the given curve segment would be visible in the box determined by lx,ly,rx,ry. If the curve in any way intersects the box, true is returned.
References calculate_cubicbezier(), CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), CLLineSegment::isBezier(), segments_intersect_2d(), CLLineSegment::setEnd(), CLLineSegment::setIsBezier(), CLLineSegment::setStart(), CLPoint::setX(), CLPoint::setY(), and CLPoint::setZ().
Referenced by is_curve_visible().
|
static |
Checks if the given curve would be visible in the box determined by lx,ly,rx,ry. If the curve in any way intersects the box, true is returned.
References CLCurve::getNumCurveSegments(), CLCurve::getSegmentAt(), and is_curve_segment_visible().
Referenced by getObjectsInBoundingBox().
|
staticprotected |
Calculates if the point given as x,y is close enough to the given line segment to count as a hit.
References calculate_cubicbezier(), distance(), distancePointLineSegment(), CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), CLLineSegment::isBezier(), and NUM_BEZIER_POINTS.
Referenced by getObjectsAt().
bool CLLayoutRenderer::isSelected | ( | const CLGraphicalObject * | pObject | ) | const |
This method returns true if the given object is part of the selection and false otherwise.
References mSelection.
bool CLLayoutRenderer::isSetDeduceSpeciesReferenceRoles | ( | ) | const |
Returns true or false depending on whether the render extension deduces specie reference roles from associated model objects if there are any.
References mDeduceSpeciesReferenceRoles.
|
protected |
Maps the given arrow head to the given line segment.
References ALMOST_ZERO, draw_group(), CLLineEnding::getBoundingBox(), CLBoundingBox::getDimensions(), CLLineEnding::getGroup(), CLDimensions::getHeight(), CLLineEnding::getIsEnabledRotationalMapping(), CLRenderResolver::getLineEnding(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), mCurrentAttributes, CLGroupAttributes::mEndHead, CLGroupAttributes::mHeight, mpResolver, CLGroupAttributes::mpTransform, CLGroupAttributes::mStartHead, CLGroupAttributes::mWidth, CLGroupAttributes::mX, CLGroupAttributes::mY, CLGroupAttributes::mZ, restore_current_attributes(), and save_current_attributes().
Referenced by draw_curve().
|
protected |
Maps the relative distance to a color and set the color as an rgb value in pData. pData has to be the pointer where 4 GLfloat values are going to be stored.
References CLGradientBase::getGradientStop(), CLGradientBase::getNumGradientStops(), CLGradientStop::getOffset(), CLRelAbsVector::getRelativeValue(), CLGradientBase::getSpreadMethod(), CLGradientStop::getStopColor(), mColorMap, CLGradientBase::PAD, CLGradientBase::REFLECT, and CLGradientBase::REPEAT.
void CLLayoutRenderer::move_curve_object | ( | CLCurve * | pCurve, |
double | dx, | ||
double | dy, | ||
bool | leaveStartPoint = false , |
||
bool | leaveEndpoint = false |
||
) |
Moves a given curve object by a given vector. Optionally the method can leave the start and/or the endpoint of the curve where it is.
References CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLCurve::getNumCurveSegments(), CLCurve::getSegmentAt(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), CLLineSegment::isBezier(), CLPoint::setX(), and CLPoint::setY().
Referenced by move_reaction_glyph(), move_selection(), and move_species_reference_glyph().
void CLLayoutRenderer::move_graphical_object | ( | CLGraphicalObject * | pObject, |
double | dx, | ||
double | dy | ||
) |
Moves a given graphical object by a given vector.
References CLGraphicalObject::getBoundingBox(), CLBoundingBox::getPosition(), CLPoint::getX(), CLPoint::getY(), CLPoint::setX(), and CLPoint::setY().
Referenced by move_reaction_glyph(), move_selection(), move_species_glyph(), move_species_reference_glyph(), and move_text_glyph().
void CLLayoutRenderer::move_reaction_glyph | ( | CLReactionGlyph * | pRG, |
double | dx, | ||
double | dy, | ||
bool | moveSelectedAssociations = false |
||
) |
Moves the given reaction glyph by the given vector. The startpoints of all associated species reference glyphs are moved as well if they are represented by curves otherwise the comple species reference glyph is moved. Also all associated text glyphs are moved. The moveSelectedAssociations determines whether associated objects that are selected are moved with this object or not. The reason for this is that selected object might be part of the moving process and the objects would in this case be changed twice.
Moves the given reaction glyph by the given vector. The startpoints of all associated species reference glyphs are moved as well if they are represented by curves otherwise the comple species reference glyph is moved. Also all associated text glyphs are moved.
References CLGlyphWithCurve::getCurve(), CLLineSegment::getEnd(), CLCurve::getNumCurveSegments(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), mGraphicalObjectToTextGlyphMap, move_curve_object(), move_graphical_object(), mReactionToSpeciesReferenceMap, mSelection, CLPoint::setX(), and CLPoint::setY().
Referenced by move_selection().
void CLLayoutRenderer::move_selection | ( | double | dx, |
double | dy, | ||
bool | moveAssociated = true |
||
) |
Moves the current selection. If the moveAssociations falg is set to true, associated objects that are not selected are moved as well. In the case of associated species reference glyphs this means that the start and/or endpoint is moved.
References CLGlyphWithCurve::getCurve(), CLCurve::getNumCurveSegments(), move_curve_object(), move_graphical_object(), move_reaction_glyph(), move_species_glyph(), move_species_reference_glyph(), move_text_glyph(), and mSelection.
void CLLayoutRenderer::move_species_glyph | ( | CLMetabGlyph * | pSG, |
double | dx, | ||
double | dy, | ||
bool | moveSelectedAssociations = false |
||
) |
Moves the given Species glyph by the given vector. The endpoints of all associated species reference glyphs are moved as well if they are represented by curves. Also all associated text glyphs are moved. The moveSelectedAssociations determines whether associated objects that are selected are moved with this object or not. The reason for this is that selected object might be part of the moving process and the objects would in this case be changed twice.
Moves the given Species glyph by the given vector. The endpoints of all associated species reference glyphs are moved as well if they are represented by curves. Also all associated text glyphs are moved.
References CLLineSegment::getEnd(), CLLineSegment::getStart(), CLPoint::getX(), CLPoint::getY(), mGraphicalObjectToTextGlyphMap, move_graphical_object(), mSelection, mSpeciesToSpeciesReferenceMap, CLPoint::setX(), and CLPoint::setY().
Referenced by move_selection().
void CLLayoutRenderer::move_species_reference_glyph | ( | CLMetabReferenceGlyph * | pSRG, |
double | dx, | ||
double | dy | ||
) |
Moves the species reference glyph. If the glpyh is represented by a curve, the curves start and endpoint are left as they are.
References CLGlyphWithCurve::getCurve(), CLCurve::getNumCurveSegments(), move_curve_object(), and move_graphical_object().
Referenced by move_selection().
void CLLayoutRenderer::move_text_glyph | ( | CLTextGlyph * | pTG, |
double | dx, | ||
double | dy | ||
) |
Moves the given text glyph by the given vector. For now, we do not move any associated object becuase it is difficult to create a behaviour that makes sense. E.g. if the associated object is a species glyph, all species reference glyphs might have to be moved. So for now, it is easier to only move the text and if the user wants to move the text with the associated object, he/she needs to move the object instead.
References move_graphical_object().
Referenced by move_selection().
void CLLayoutRenderer::removeFromSelection | ( | CLGraphicalObject * | pObject | ) |
This method removes the given object from the selection if it is selected.
References draw_layout(), and mSelection.
void CLLayoutRenderer::resize | ( | GLsizei | w, |
GLsizei | h | ||
) |
Resize method that is called whenever the GL window is resized.
References analyse_render_information(), mAspect, mH, mW, mX, mY, and mZoomFactor.
|
protected |
Method that converts a color value or a color id into a color array for OpenGL.
References CLColorDefinition::getAlpha(), CLColorDefinition::getBlue(), CLRenderResolver::getColorDefinition(), CLColorDefinition::getGreen(), CLColorDefinition::getRed(), mpResolver, and CLColorDefinition::setColorValue().
Referenced by update_colors(), and update_textures_and_colors().
|
staticprotected |
Method to resolve the text that belongs to a text glyph.
References CLTextGlyph::getText(), and CLTextGlyph::isTextSet().
Referenced by update_textures_and_colors().
|
protected |
Restores the current attributes from the stack. Any transformation object that might have been created after the last call to save_current_attributes will be deleted.
References mCurrentAttributes, and mStateList.
Referenced by draw_curve(), draw_ellipse(), draw_group(), draw_image(), draw_layout(), draw_polygon(), draw_rectangle(), draw_text(), and map_arrow_head().
reverts the direction of the given curve. The result is returned as a new curve object and the caller has to make sure that the memory for the new curve is freed.
References CLCurve::addCurveSegment(), CLLineSegment::getBase1(), CLLineSegment::getBase2(), CLLineSegment::getEnd(), CLCurve::getNumCurveSegments(), CLCurve::getSegmentAt(), CLLineSegment::getStart(), CLLineSegment::isBezier(), CLLineSegment::setBase1(), CLLineSegment::setBase2(), and CLLineSegment::setIsBezier().
|
protected |
Stores the current attributes on a stack.
References mCurrentAttributes, and mStateList.
Referenced by draw_curve(), draw_ellipse(), draw_group(), draw_image(), draw_layout(), draw_polygon(), draw_rectangle(), draw_text(), and map_arrow_head().
|
protected |
This method takes a number of datapoints for a curve and segments the curve into pieces that have a datapoint at every multiple of length. This is needed if we need to apply line stippling for OpenGL < 2.0 where texture sizes have to be a power of 2.
References ALMOST_ZERO, simple_point::mS, simple_point::mX, simple_point::mY, and simple_point::mZ.
Referenced by draw_line().
|
staticprotected |
Calculates wether 2d segments intersect within the length of the segments. Calls calculate_intersection_point_2d.
References ALMOST_ZERO, and calculate_intersection_point_2d().
Referenced by is_curve_segment_visible().
void CLLayoutRenderer::set_font_renderer | ( | CLFontRendererBase * | pFontRenderer | ) |
Sets a function that is able to generate a texture spec from some given font settings and a piece of text.
References mpFontRenderer.
void CLLayoutRenderer::setAspect | ( | double | aspect | ) |
Sets the aspect.
References mAspect.
void CLLayoutRenderer::setDeduceSpeciesReferenceRoles | ( | bool | deduce | ) |
Sets whether the render extension is to deduce specie reference roles from associated model objects if there are any.
References analyse_render_information(), CDataVector< CType >::begin(), clear_cached_data(), CReaction::getChemEq(), CDataObject::getKey(), CLReactionGlyph::getListOfMetabReferenceGlyphs(), CLayout::getListOfReactionGlyphs(), CLGraphicalObject::getModelObjectKey(), CChemEq::getModifiers(), CLGraphicalObject::getObjectRole(), CChemEq::getProducts(), CModel::getReactions(), CChemEq::getSubstrates(), CDataVector< CType >::insert(), CReaction::isReversible(), mDeduceSpeciesReferenceRoles, mH, mpFontRenderer, mpLayout, mpModel, mSpeciesReferencesWithDeducedRole, mW, mX, mY, mZoomFactor, and CDataVector< CType >::size().
Referenced by change_style().
void CLLayoutRenderer::setFogColor | ( | const GLfloat | c[4] | ) |
Sets the fog color.
References mFogColor.
void CLLayoutRenderer::setFogDensity | ( | GLfloat | dens | ) |
Sets the fog density.
References mFogDensity.
void CLLayoutRenderer::setHighlightColor | ( | const GLfloat | c[4] | ) |
Sets the highlight color.
References mHighlightColor.
void CLLayoutRenderer::setHighlightedObjects | ( | const std::set< const CLGraphicalObject * > & | highlightedObjects | ) |
Sets the list of model objects that are to be highlighted in the diagram.
References mHighlightedObjects.
void CLLayoutRenderer::setHighlightFlag | ( | bool | flag | ) |
Toggles the flag that determines if highlighted objects are actually highlighted or if the rest is fogged out.
References mHighlight.
void CLLayoutRenderer::setImageTexturizer | ( | CLImageTexturizer * | pTexturizer | ) |
Sets the class that can create textures from a given image file.
References mpImageTexturizer.
void CLLayoutRenderer::setSelectionBox | ( | const CLBoundingBox * | pBox | ) |
Sets the current selection box. Setting the Box to NULL means that no selection box is drawn.
References mpSelectionBox.
void CLLayoutRenderer::setX | ( | double | x | ) |
This method sets the left edge of the viewport.
References mX.
void CLLayoutRenderer::setY | ( | double | y | ) |
This method sets the upper edge of the viewport.
References mY.
void CLLayoutRenderer::setZoomFactor | ( | double | zoomFactor | ) |
Sets the zoom factor.
References mZoomFactor.
|
staticprotected |
This method is used as a callback for the GLU tesselator to report errors during the tesselation process.
References CCopasiMessage::EXCEPTION.
Referenced by draw_datapoints().
void CLLayoutRenderer::toggleHighlightFlag | ( | ) |
Toggles the flag that determines if highlighted objects are actually highlighted or if the rest is fogged out.
References mHighlight.
|
protected |
Updates the associations of species reference glyphs and text glyphs.
References distance(), CReaction::getChemEq(), CLGlyphWithCurve::getCurve(), CLTextGlyph::getGraphicalObjectKey(), CDataObject::getKey(), CLGraphicalObject::getKey(), CLayout::getListOfCompartmentGlyphs(), CLayout::getListOfGeneralGlyphs(), CLayout::getListOfMetaboliteGlyphs(), CLReactionGlyph::getListOfMetabReferenceGlyphs(), CLayout::getListOfReactionGlyphs(), CLayout::getListOfTextGlyphs(), CLMetabReferenceGlyph::getMetabGlyphKey(), CLGraphicalObject::getModelObjectKey(), CChemEq::getModifiers(), CLCurve::getNumCurveSegments(), CChemEq::getProducts(), CModel::getReactions(), CLCurve::getSegmentAt(), CLLineSegment::getStart(), CChemEq::getSubstrates(), mGraphicalObjectToTextGlyphMap, mpLayout, mpModel, mReactionToSpeciesReferenceMap, mSpeciesReferenceToReactionMap, mSpeciesReferenceToSpeciesMap, mSpeciesToSpeciesReferenceMap, mTextGlyphToGraphicalObjectMap, and CDataVector< CType >::size().
Referenced by update_drawables().
|
protected |
This methods extracts all colors from the given gradient and adds them to the color map.
References CLGradientBase::getGradientStop(), CLGradientBase::getNumGradientStops(), CLGradientStop::getStopColor(), mColorMap, and resolve_color().
Referenced by update_textures_and_colors().
|
protected |
This method goes through all layout objects and checks them if they are within the current viewport. If they are, they are added to the list of objects that are drawn. An object is within the viewport if it's bounding box or parts of it are within the viewport. For curves, each start, end and base point is checked and if any of those is within the viewport, the curve is added to the list. The viewport is specified by its lower left (lx,ly) and upper right point (rx,ry).
References getObjectsInBoundingBox(), mDrawables, and update_associations().
Referenced by analyse_render_information().
|
protected |
This method goes throught the list of all drawables and tries to resolve the style for each object.
References mDrawables, mpResolver, mStyleMap, and CLRenderResolver::resolveStyle().
Referenced by analyse_render_information().
|
protected |
This method goes through all styles that are used by the current drawables and figures out which gradients, colors and line stipples are used and creates them.
References ALMOST_ZERO, create_gradient_texture(), CLLineEnding::getBoundingBox(), CLGlyphWithCurve::getCurve(), CLBoundingBox::getDimensions(), getFontSpec(), CLLineEnding::getGroup(), CLDimensions::getHeight(), CLCurve::getNumCurveSegments(), CLDimensions::getWidth(), GL_CLAMP_TO_EDGE, GRADIENT_TEXTURE_SIZE_LIMIT, CLFontSpec::mFamily, mFontTextureMap, mGradientMap, mLineEndingMap, CLTextTextureSpec::mMaxScale, mpFontRenderer, CLTextTextureSpec::mScale, CLFontSpec::mSize, CLFontSpec::mStyle, mStyleMap, mTextGlyphMap, CLTextureSpec::mTextHeight, CLTextureSpec::mTextureHeight, CLTextureSpec::mTextureName, CLTextureSpec::mTextureWidth, CLTextureSpec::mTextWidth, CLFontSpec::mWeight, mZoomFactor, and resolve_text().
Referenced by analyse_render_information(), and update_textures_and_colors().
|
protected |
Goes through all render objects in the given group and updates the color map and gradients. The maxDimension parameter is the maximum of the width and the height of the corresponding layout object. This value is needed to determine the size of gradient textures.
References ALMOST_ZERO, createLineStippleTexture(), CLGraphicalPrimitive1D::getDashArray(), CLGroup::getElement(), CLGroup::getEndHead(), CLRenderCurve::getEndHead(), CLGraphicalPrimitive2D::getFillColor(), getFontSpec(), CLRenderResolver::getGradientBase(), CLRenderResolver::getLineEnding(), CLGroup::getNumElements(), CLGroup::getStartHead(), CLRenderCurve::getStartHead(), CLGraphicalPrimitive1D::getStroke(), CLText::getText(), GL_CLAMP_TO_EDGE, CLGraphicalPrimitive1D::isSetDashArray(), CLGroup::isSetEndHead(), CLRenderCurve::isSetEndHead(), CLGraphicalPrimitive2D::isSetFill(), CLGroup::isSetStartHead(), CLRenderCurve::isSetStartHead(), CLGraphicalPrimitive1D::isSetStroke(), mColorMap, CLFontSpec::mFamily, mFontTextureMap, mGradientMap, mLineEndingMap, mLinestippleMap, CLTextTextureSpec::mMaxScale, mpFontRenderer, mpResolver, CLTextTextureSpec::mScale, CLFontSpec::mSize, CLFontSpec::mStyle, CLTextureSpec::mTextHeight, mTextMap, CLTextureSpec::mTextureName, CLTextureSpec::mTextWidth, CLFontSpec::mWeight, mZoomFactor, resolve_color(), update_colors(), and update_textures_and_colors().
|
staticprotected |
This method is used as a callback for the GLU tesselator. It is called for every vertex that is processed by the tesselator. We need it to calculate the gradient colors at each vertex.
Referenced by draw_datapoints().
|
staticprotected |
|
staticprotected |
Referenced by update_textures_and_colors().
|
protected |
Referenced by getAspect(), resize(), and setAspect().
|
protected |
Referenced by draw_image().
|
protected |
|
protected |
|
protected |
Referenced by change_style(), isSetDeduceSpeciesReferenceRoles(), and setDeduceSpeciesReferenceRoles().
|
protected |
Referenced by clear_cached_data(), draw_layout(), getObjectsAt(), update_drawables(), and update_style_information().
|
protected |
Referenced by CLLayoutRenderer(), draw_layout(), getFogColor(), and setFogColor().
|
protected |
Referenced by draw_layout(), getFogDensity(), and setFogDensity().
|
protected |
Referenced by clear_cached_data(), and update_textures_and_colors().
|
protected |
Referenced by draw_layout(), and initialize_gl_extension_functions().
|
protected |
Referenced by clear_cached_data(), draw_datapoints(), and update_textures_and_colors().
|
protected |
Referenced by move_reaction_glyph(), move_species_glyph(), and update_associations().
|
protected |
Referenced by change_style(), draw_selection_box(), getObjectsAt(), resize(), and setDeduceSpeciesReferenceRoles().
|
protected |
Referenced by draw_layout(), getHighlightFlag(), setHighlightFlag(), and toggleHighlightFlag().
|
protected |
Referenced by CLLayoutRenderer(), draw_layout(), getHighlightColor(), and setHighlightColor().
|
protected |
Referenced by draw_layout(), getHighlightedObjects(), and setHighlightedObjects().
|
protected |
Referenced by clear_cached_data(), and draw_image().
|
protected |
Referenced by clear_cached_data(), and update_textures_and_colors().
|
protected |
Referenced by clear_cached_data(), draw_line(), and update_textures_and_colors().
|
protected |
|
protected |
Referenced by draw_layout(), and initialize_gl_extension_functions().
|
protected |
Referenced by change_style().
|
protected |
Referenced by draw_image(), and setImageTexturizer().
|
protected |
|
protected |
Referenced by setDeduceSpeciesReferenceRoles(), and update_associations().
|
protected |
|
protected |
Referenced by draw_selection_box(), getSelectionBox(), setSelectionBox(), and ~CLLayoutRenderer().
|
protected |
Referenced by move_reaction_glyph(), and update_associations().
|
protected |
|
protected |
Referenced by change_style(), and setDeduceSpeciesReferenceRoles().
|
protected |
Referenced by update_associations().
|
protected |
Referenced by update_associations().
|
protected |
Referenced by move_species_glyph(), and update_associations().
|
protected |
Referenced by restore_current_attributes(), and save_current_attributes().
|
protected |
Referenced by clear_cached_data(), draw_layout(), update_style_information(), and update_textures_and_colors().
|
protected |
Referenced by clear_cached_data(), draw_layout(), and update_textures_and_colors().
|
protected |
Referenced by update_associations().
|
protected |
Referenced by clear_cached_data(), draw_text(), and update_textures_and_colors().
|
protected |
|
protected |
Referenced by change_style(), draw_selection_box(), getObjectsAt(), resize(), and setDeduceSpeciesReferenceRoles().
|
protected |
Referenced by change_style(), convert_to_model_space(), draw_selection_box(), getObjectsAt(), resize(), setDeduceSpeciesReferenceRoles(), and setX().
|
protected |
Referenced by change_style(), convert_to_model_space(), draw_selection_box(), getObjectsAt(), resize(), setDeduceSpeciesReferenceRoles(), and setY().
|
protected |
|
staticprotected |
Referenced by draw_curve(), draw_polygon(), and isSegmentHit().
|
staticprotected |
Referenced by draw_curve(), and draw_ellipse().
|
staticprotected |
Referenced by draw_rectangle().
|
staticprotected |
Referenced by drawSelectionBox().