6 #ifndef CLLAYOUTRENDERER_H__
7 #define CLLAYOUTRENDERER_H__
56 #define STD_CALL _stdcall
96 std::map<std::string, std::pair<const CLGradientBase*, CLTextureSpec*> >
mGradientMap;
107 std::map<const CLGraphicalObject*, const CLStyle*>
mStyleMap;
129 std::map<const CLText*, const CLTextTextureSpec*>
mTextMap;
242 void resize(GLsizei w, GLsizei h);
312 const std::set<CLGraphicalObject*>&
getSelection()
const;
328 std::multiset<CLGraphicalObject*, compareGraphicalObjectsBySize>
getObjectsAt(
double x,
double y);
351 std::vector<CLGraphicalObject*>
getObjectsInBoundingBox(
double lx,
double ly,
double rx,
double ry,
bool partial =
true);
384 void move_curve_object(
CLCurve* pCurve,
double dx,
double dy,
bool leaveStartPoint =
false,
bool leaveEndpoint =
false);
436 void move_selection(
double dx,
double dy,
bool moveAssociated =
true);
561 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);
605 void resolve_color(
const std::string& color, GLubyte array[4]);
647 template <
typename T>
650 assert(pObject != NULL);
652 if (pObject == NULL)
return;
654 if (pObject->isSetFontFamily())
656 attributes->
mFontFamily = pObject->getFontFamily();
659 if (pObject->isSetFontSize())
661 attributes->
mFontSize = pObject->getFontSize();
664 if (pObject->isSetFontWeight())
666 attributes->
mFontWeight = pObject->getFontWeight();
669 if (pObject->isSetFontStyle())
671 attributes->
mFontStyle = pObject->getFontStyle();
674 if (pObject->isSetTextAnchor())
676 attributes->
mTextAnchor = pObject->getTextAnchor();
679 if (pObject->isSetVTextAnchor())
695 template <
typename T>
698 if (pObject->isSetStartHead())
700 attributes->
mStartHead = pObject->getStartHead();
703 if (pObject->isSetEndHead())
705 attributes->
mEndHead = pObject->getEndHead();
757 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);
776 static void __stdcall
COMBINE_CALLBACK(GLdouble coords[3], GLdouble** , GLfloat* , GLdouble** dataOut);
778 static void COMBINE_CALLBACK(GLdouble coords[3], GLdouble** , GLfloat* , GLdouble** dataOut);
797 static void __stdcall
COMBINE_CALLBACK_GRADIENT(GLdouble coords[3], GLdouble* vertex_data[4], GLfloat weight[4], GLdouble** dataOut);
799 static void COMBINE_CALLBACK_GRADIENT(GLdouble coords[3], GLdouble* vertex_data[4], GLfloat weight[4], GLdouble** dataOut);
807 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);
812 void draw_line(
size_t numPoints, GLdouble* pData);
814 static void createGLMatrix(
const double*
const matrix, GLdouble* glMatrix);
830 void segment_data(
double length,
double ratio,
size_t numPoints, GLdouble* pData, std::vector<simple_point>& v);
904 void draw_cap(
double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
double x3,
double y3,
double z3,
double stroke_width);
916 double p2x,
double p2y,
double p2z,
double tx,
double ty,
double tz);
924 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);
930 static bool segments_intersect_2d(
double p1x1,
double p1y1,
double p1x2,
double p1y2,
double p2x1,
double p2y1,
double p2x2,
double p2y2);
955 static void drawSelectionBox(
double x,
double y,
double width,
double height,
bool drawHandles =
false);
975 void * MyNSGLGetProcAddress(
const char *name);
979 #endif // CLLAYOUTRENDERER_H__
static void createGLMatrix(const double *const matrix, GLdouble *glMatrix)
void move_selection(double dx, double dy, bool moveAssociated=true)
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)
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)
CLBoundingBox * mpSelectionBox
bool mDeduceSpeciesReferenceRoles
void draw_object(const CLStyle *pStyle, const CLBoundingBox *pBB)
GLfloat mHighlightColor[4]
void update_associations()
void move_text_glyph(CLTextGlyph *pTG, double dx, double dy)
std::map< const CLText *, const CLTextTextureSpec * > mTextMap
static bool is_curve_segment_visible(const CLLineSegment &segment, double lx, double ly, double rx, double ry, bool partial)
const GLfloat * getFogColor() const
std::vector< const CLGraphicalObject * > mDrawables
std::set< GLuint > mTextureNames
static const double ALMOST_ZERO
bool mGLFunctionsInitialized
std::set< CLGraphicalObject * > mSelection
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > getObjectsAtViewportPosition(unsigned int x, unsigned int y)
static const unsigned int NUM_CIRCLE_SEGMENTS
static const unsigned int GRADIENT_TEXTURE_SIZE_LIMIT
std::stack< CLGroupAttributes > mStateList
void update_colors(const CLGradientBase *pGradient)
CLText::TEXT_ANCHOR mTextAnchor
void draw_ellipse(const CLEllipse *pEllipse, const CLBoundingBox *pBB)
void resolve_color(const std::string &color, GLubyte array[4])
static CLLineStippleTexture * createLineStippleTexture(const std::vector< unsigned int > &dasharray)
void move_species_glyph(CLMetabGlyph *pSG, double dx, double dy, bool moveSelectedAssociations=false)
static double distance(const CLPoint &p1, const CLPoint &p2)
void setHighlightFlag(bool flag)
CLImageTexturizer * mpImageTexturizer
void update_drawables(double lx, double ly, double rx, double ry)
std::map< CLMetabReferenceGlyph *, std::pair< CLMetabGlyph *, bool > > mSpeciesReferenceToSpeciesMap
static void extract_group_attributes(const CLStyle *pStyle, CLGroupAttributes *attributes)
std::map< CLMetabGlyph *, std::set< std::pair< CLMetabReferenceGlyph *, bool > > > mSpeciesToSpeciesReferenceMap
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 map_arrow_head(const CLPoint &p, const CLPoint &v, const std::string &headId)
std::map< CLTextGlyph *, CLGraphicalObject * > mTextGlyphToGraphicalObjectMap
static bool segments_intersect_2d(double p1x1, double p1y1, double p1x2, double p1y2, double p2x1, double p2y1, double p2x2, double p2y2)
static const CLPoint convert_to_absolute(const CLRenderPoint *pRenderPoint, const CLBoundingBox *pBB)
void setAspect(double aspect)
CLLayoutRenderer(CLayout *pLayout, const CLGlobalRenderInformation *pRenderInformation, const CCopasiVector< CLGlobalRenderInformation > *pGlobalRenderInformationList, const CModel *pModel, const std::string &baseDir)
const std::set< const CLGraphicalObject * > & getHighlightedObjects() const
CLText::FONT_STYLE mFontStyle
static void extract_2d_attributes(const CLGraphicalPrimitive2D *pObject, CLGroupAttributes *attributes)
void create_radial_gradient_texture(unsigned int size, GLubyte *pData, const CLRadialGradient *pGradient, double z_value)
void create_linear_gradient_texture(unsigned int size, GLubyte *pData, const CLLinearGradient *pGradient, double z_value)
static void extract_arrowhead_information(const T *pObject, CLGroupAttributes *attributes)
std::map< const CLTextGlyph *, const CLTextTextureSpec * > mTextGlyphMap
void draw_polygon(const CLPolygon *pPolygon, const CLBoundingBox *pBB)
std::map< std::string, std::pair< const CLGradientBase *, CLTextureSpec * > > mGradientMap
void update_style_information()
void draw_text(const CLStyle *pStyle, const CLBoundingBox *pBB, const CLTextTextureSpec *pTexture)
void resize(GLsizei w, GLsizei h)
void setSelectionBox(const CLBoundingBox *pBox)
CLGroupAttributes mCurrentAttributes
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 void drawSelectionBox(double x, double y, double width, double height, bool drawHandles=false)
std::set< const CLGraphicalObject * > mHighlightedObjects
static const unsigned int NUM_CORNER_SEGMENTS
static const std::string resolve_text(const CLTextGlyph *pTextGlyph)
std::map< CLGraphicalObject *, std::set< CLTextGlyph * > > mGraphicalObjectToTextGlyphMap
std::multiset< CLGraphicalObject *, compareGraphicalObjectsBySize > getObjectsAt(double x, double y)
double getZoomFactor() const
const CCopasiVector< CLGlobalRenderInformation > * mpGlobalRenderInfoList
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 extract_transformation_attributes(const CLTransformation *pObject, CLGroupAttributes *attributes)
void setZoomFactor(double zoomFactor)
std::map< CLReactionGlyph *, std::set< std::pair< CLMetabReferenceGlyph *, bool > > > mReactionToSpeciesReferenceMap
std::map< CLMetabReferenceGlyph *, std::pair< CLReactionGlyph *, bool > > mSpeciesReferenceToReactionMap
const GLfloat * getHighlightColor() const
void setHighlightColor(const GLfloat c[4])
static void TESS_ERROR(GLenum error)
void addToSelection(CLGraphicalObject *pObject)
void setImageTexturizer(CLImageTexturizer *pTexturizer)
void move_reaction_glyph(CLReactionGlyph *pRG, double dx, double dy, bool moveSelectedAssociation=false)
static const double SELECTION_FRAME_WIDTH
void draw_cap(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double stroke_width)
std::map< std::string, const CLTextureSpec * > mImageMap
std::map< const std::vector< unsigned int >, const CLLineStippleTexture * > mLinestippleMap
std::map< std::string, CLRGBAColor > mColorMap
static void COMBINE_CALLBACK(GLdouble coords[3], GLdouble **, GLfloat *, GLdouble **dataOut)
void draw_group(const CLGroup *pGroup, const CLBoundingBox *pBB)
bool getHighlightFlag() const
static const unsigned int NUM_BEZIER_POINTS
static void extract_1d_attributes(const CLGraphicalPrimitive1D *pObject, CLGroupAttributes *attributes)
static CLCurve * revert_curve(const CLCurve *pCurve)
void setFogColor(const GLfloat c[4])
static CLBoundingBox * getCurveBoundingBox(const CLCurve *pCurve)
std::map< const CLMetabReferenceGlyph *, std::string > mSpeciesReferencesWithDeducedRole
CLBoundingBox * getSelectionBox()
void removeFromSelection(CLGraphicalObject *pObject)
void save_current_attributes()
void move_species_reference_glyph(CLMetabReferenceGlyph *pSRG, double dx, double dy)
void restore_current_attributes()
std::pair< double, double > convert_to_model_space(double x, double y) const
void move_curve_object(CLCurve *pCurve, double dx, double dy, bool leaveStartPoint=false, bool leaveEndpoint=false)
void change_style(const CLGlobalRenderInformation *pRenderInformation, bool defaultStyle=false)
void setFogDensity(GLfloat dens)
static bool isSegmentHit(const CLLineSegment *pLS, double x, double y, double toleranceRadius)
CLFontRendererBase * mpFontRenderer
std::vector< CLGraphicalObject * > getObjectsInBoundingBox(double lx, double ly, double rx, double ry, bool partial=true)
static double distancePointLineSegment(double x, double y, double lx1, double ly1, double lx2, double ly2)
std::map< std::string, const CLLineEnding * > mLineEndingMap
bool isSelected(const CLGraphicalObject *) const
static void COMBINE_CALLBACK_GRADIENT(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut)
void draw_rectangle(const CLRectangle *pRectangle, const CLBoundingBox *pBB)
static void extract_text_attributes(const T *pObject, CLGroupAttributes *attributes)
std::map< CLFontSpec, std::map< std::string, CLTextTextureSpec * > > mFontTextureMap
void(* mpGlFogCoordfEXT)(GLfloat)
void initialize_gl_extension_functions()
GLfloat getFogDensity() const
CLText::TEXT_ANCHOR mVTextAnchor
std::set< CLGraphicalObject * > & getSelection()
void create_gradient_texture(unsigned int size, GLubyte *pData, const CLGradientBase *pGradient, double z_value=0.0)
CLText::FONT_WEIGHT mFontWeight
void set_font_renderer(CLFontRendererBase *pFontRenderer)
CLRenderResolver * mpResolver
bool isSetDeduceSpeciesReferenceRoles() const
void segment_data(double length, double ratio, size_t numPoints, GLdouble *pData, std::vector< simple_point > &v)
static bool is_curve_visible(const CLCurve &curve, double lx, double ly, double rx, double ry, bool partial)
void draw_selection_box() const
void toggleHighlightFlag()
void setDeduceSpeciesReferenceRoles(bool deduce)
void analyse_render_information(double lx, double ly, double rx, double ry)
void move_graphical_object(CLGraphicalObject *pObject, double dx, double dy)
static CLFontSpec getFontSpec(const CLGroup *pGroup, double boxHeight, const CLFontSpec &parentFontSpec=CLFontSpec())
void draw_curve(const CLCurve *pCurve, bool drawBasepoints=false)
void draw_line(size_t numPoints, GLdouble *pData)
void map_gradient_color(double rel_distance, const CLGradientBase *pGradient, GLubyte *pData)
void setHighlightedObjects(const std::set< const CLGraphicalObject * > &highlightedObjects)
static void VERTEX_CALLBACK_GRADIENT(GLvoid *vertex)
std::map< const CLGraphicalObject *, const CLStyle * > mStyleMap
void draw_image(const CLImage *pImage, const CLBoundingBox *pBB)
void update_textures_and_colors()