/* Copyright (C) 2019-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: WxdkdrawObj.cpt */ #ifndef WXDKDRAWOBJ_H_INCLUDED /** Avoid multiple inclusions. */ #define WXDKDRAWOBJ_H_INCLUDED 1 #line 8 "WxdkdrawObj.cpt" /** @file WxdkdrawObj.h Graphics elements handling. */ #ifndef WXDKDRAWTYPES_H_INCLUDED #include "WxdkdrawTypes.h" #endif #ifndef WXDENUM_H_INCLUDED #include "wxdenum.h" #endif /* PROTOTYPES (start) */ /* Create and destroy drawing -------------------------- */ /** Open a new empty drawing. @return Valid pointer on success, NULL on error (not enough memory). */ Wxd_drawing_t * wxdobj_drw_new(void); /** Delete drawing including all contents. @param pdrw Drawing to delete. */ void wxdobj_drw_delete(Wxd_drawing_t *pdrw); /** Set required redraw level. During handling one event this function may be called multiple times. The maximum of the required redraw levels is saved in the drawing. @param pdrw Drawing to update. @param level Required minimum redraw level. */ void wxdobj_drw_require_redraw(Wxd_drawing_t *pdrw, int level); /** Retrieve required redraw level. This function should be called at the end of event handlers to check whether or not to refresh and update the control and from within the repaint handler to check which caches to update. @param pdrw Drawing to check. @param level Required redraw level already found. @return Required redraw level. */ int wxdobj_drw_get_required_redraw_level( Wxd_drawing_t *pdrw, int level = WXD_REFRESH_NONE ); /** Reset required redraw level. This function should be called from the repaint handler when redrawing is done. @param pdrw Drawing to modify. */ void wxdobj_drw_reset_required_redraw_level(Wxd_drawing_t *pdrw); /* Create and destroy elements without registration and unregistration to drawing ------------------------------------------------ */ /** Initialize bounding box structure. @param pdst Structure to initialize. */ void wxdobj_det_init_bb(Wxd_bb_t *pdst); /** Initialize text details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_text(Wxd_det_text_t *pdst); /** Initialize polyline or polygon details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_poly(Wxd_det_pl_t *pdst); /** Initialize spline details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_spline(Wxd_det_xs_t *pdst); /** Initialize arc details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_arc(Wxd_det_arc_t *pdst); /** Initialize details structure for ellipse or circle. @param pdst Structure to initialize. */ void wxdobj_det_init_ellipse(Wxd_det_ellipse_t *pdst); /** Initialize box details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_box(Wxd_det_box_t *pdst); /** Initialize image details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_image(Wxd_det_image_t *pdst); /** Initialize dot details structure. @param pdst Structure to initialize. */ void wxdobj_det_init_dot(Wxd_det_dot_t *pdst); /** Initialize object, use template if specified. @param pdst Object to initialize. @param ot Object type. @param ptpl Template object, may be NULL. */ void wxdobj_obj_init(Wxd_object_t *pdst, int ot, Wxd_object_t const *ptpl = NULL); /** Delete group structure recursively. Only group structural information is deleted, graphics objects remain intact. The parent information of all graphics objects is set to NULL. */ void wxdobj_grp_delete_recursive(Wxd_object_t *pgrp); /** Create polyline object. @param np Number of points. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_polyline(uint16_t np, Wxd_object_t const *ptpl); /** Create polygon object. @param np Number of points. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_polygon(uint16_t np, Wxd_object_t const *ptpl); /** Create spline object. @param np Number of points. @param cl Flag: Closed spline. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_spline(uint16_t np, int cl, Wxd_object_t const *ptpl); /** Create arc object. @param cl Flag: Closed arc. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_arc(int cl, Wxd_object_t const *ptpl); /** Create circle object. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_circle(Wxd_object_t const *ptpl); /** Create ellipse object. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_ellipse(Wxd_object_t const *ptpl); /** Create box object. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_box(Wxd_object_t const *ptpl); /** Create image object. @param fn Image file name. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_image(wxChar const *fn, Wxd_object_t const *ptpl); /** Create dot object. @param wh Flag: White filled dot. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_dot(int wh, Wxd_object_t const *ptpl); /** Create new text label. @param te Export text. @param ptpl Style template. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_obj_new_textlabel(wxChar const *te, Wxd_object_t const *ptpl); /** Delete object, release memory. The object is not unregistered from the drawing. For a group object the storage and iterator are just closed, no recursive processing. @param pobj Object to delete. */ void wxdobj_obj_delete(Wxd_object_t *pobj); /* Create new elements in a drawing (create element and register it in the drawings storages) ---------------------------------------------------------------- */ /** Register an object in drawing and group structure. @param pdrw Drawing to register object. @param pgrp Objects parent group or NULL for a top-level element. @param pobj Object to register in drawing. */ int wxdobj_drw_register_object( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, Wxd_object_t *pobj ); /** Add a new group to a drawing, register it in structered storage. @param pdrw Drawing to add group to. @param pgrp Parent group, NULL for a new top-level group. @return Valid pointer to new group on success, NULL on error. */ Wxd_object_t * wxdobj_drw_add_group( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp ); /** Add a new polyline to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param np Number of points. @param cl Flag: Closed polyline (polygon). @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_polyline( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, uint16_t np, int cl, Wxd_object_t const *ptpl ); /** Add point to polygon or polyline. @param pobj Polygon or polyline to modify. @param pind Index of new point. @param erp Error report, may be NULL. @return True on success, false on error (memory). */ bool wxdobj_add_polypoint( Wxd_object_t *pobj, uint16_t pind, dk4_er_t *erp ); /** Delete one polyline or polygon point. @param pobj Polyline or polygon object to modify. @param pind Index of point to delete. @param erp Error report, may be NULL. @return True on success, false on error (memory). */ bool wxdobj_del_polypoint( Wxd_object_t *pobj, uint16_t pind, dk4_er_t *erp ); /** Add a new spline to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param np Number of points. @param cl Flag: Closed spline. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_spline( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, uint16_t np, int cl, Wxd_object_t const *ptpl ); /** Add point to spline. @param pobj Spline to modify. @param pind Index of new point. @param erp Error report, may be NULL. @return True on success, false on error (memory). */ bool wxdobj_add_splinepoint( Wxd_object_t *pobj, uint16_t pind, dk4_er_t *erp ); /** Delete one spline point. @param pobj Open or closed spline object to modify. @param pind Index of point to delete. @param erp Error report, may be NULL. @return True on success, false on error (memory). */ bool wxdobj_del_splinepoint( Wxd_object_t *pobj, uint16_t pind, dk4_er_t *erp ); /** Add a new arc to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param cl Flag: Closed polyline (polygon). @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_arc( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, int cl, Wxd_object_t const *ptpl ); /** Add a new circle to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_circle( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, Wxd_object_t const *ptpl ); /** Add a new ellipse to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_ellipse( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, Wxd_object_t const *ptpl ); /** Add a new box to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_box( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, Wxd_object_t const *ptpl ); /** Add a new polyline to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param fn File name of image file. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_image( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, wxChar const *fn, Wxd_object_t const *ptpl ); /** Add a new dot to drawing and register it in the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param wh Flag: White filled dot. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_dot( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, int wh, Wxd_object_t const *ptpl ); /** Add a new text label to the drawing and register it to the storages. @param pdrw Drawing to add to. @param pgrp Parent group, NULL for top-level object. @param te Export text. @param ptpl Style template, may be NULL. @return Valid pointer on success, NULL on error. */ Wxd_object_t * wxdobj_add_textlabel( Wxd_drawing_t *pdrw, Wxd_object_t *pgrp, wxChar const *te, Wxd_object_t const *ptpl ); /* Modify elements within a drawing, update registration if necessary ----------------------------------------------------- */ /** Check whether or not object is active. @param pobj Object to check. @return True normally, false for objects on inactive layers. */ bool wxdobj_is_active(Wxd_object_t *pobj); /** Increase point number of polyline or polygon by one (after clicking on a new point to add). @param pobj Object to modify. @return 1 on success, 0 on error. */ int wxdobj_mod_poly_add_point( Wxd_object_t *pobj ); /** Decrease point number of polyline or polygon by one (after right-clicking for finalizing). @param pobj Object to modify. @return 1 on success, 0 on error. */ int wxdobj_mod_poly_del_point( Wxd_object_t *pobj ); /** Increase point number of spline by one (after clicking on a new point to add). @param pobj Object to modify. @return 1 on success, 0 on error. */ int wxdobj_mod_spline_add_point( Wxd_object_t *pobj ); /** Decrease point number of spline by one (after right-clicking for finalizing). @param pobj Object to modify. @return 1 on success, 0 on error. */ int wxdobj_mod_spline_del_point( Wxd_object_t *pobj ); /** Find group containing an object. @param pdrw Drawing containing the object. @param pobj Object to search for. @return Valid pointer to group on success, NULL on error. */ Wxd_object_t * wxdobj_find_group_for(Wxd_drawing_t *pdrw, Wxd_object_t *pobj); /** Ensure object has layer structure pointer. @param pdrw Drawing. @param pobj Object to check. @return 1 on success, 0 on error. */ int wxdobj_find_layer_structure(Wxd_drawing_t *pdrw, Wxd_object_t *pobj); /** Check whether an object needs a stipple structure. @param pobj Object to check. @return 1 for true, 0 for false. */ int wxdobj_needs_stipple( Wxd_object_t *pobj ); /** Modify layer of an object. This includes reorganization of sorted storages. @param pdrw Drawing to modify. @param pobj Object for layer change. @param nl New layer number. @return 1 on success, 0 on error. */ int wxdobj_modify_layer( Wxd_drawing_t *pdrw, Wxd_object_t *pobj, int16_t nl ); /** Correct bounding box and/or generic rectangle. @param bbptr Rectangle to correct. */ void wxdobj_bb_correct(Wxd_bb_t *bbptr, uint16_t *ppoint = NULL); /** Check for incorrect rectangle (width or height 0 or negative). @param bbptr Rectangle to check. @return True for incorrect rectangle. */ bool wxdobj_bb_is_null_area(Wxd_bb_t *bbptr); /** Check two rectangles for intersection, find intersection area if any. The intersection area is saved to res only if the function returns true. @param res Address of result rectangle variable. @param a One rectangle to check. @param b Other rectangle to check. @return True if there is any intersection, false otherwise. */ bool wxdobj_bb_intersection( Wxd_bb_t *res, Wxd_bb_t const *a, Wxd_bb_t const *b ); /** Find bitmap type for file name. @param fn File name to check. @return Bitmap image type on success, wxBITMAP_TYPE_INVALID on error (file name has no suffix or suffix not in the list of supported types). */ wxBitmapType wxdobj_image_type(wxChar const *fn); /** Load image from file. @param pobj Image object, must be type WXD_OT_IMAGE. @param dkenc Encoding used for dkChar strings. @param wxenc Encoding used for wxChar strings. */ void wxdobj_load_image( Wxd_object_t *pobj, int dkenc, int wxenc ); /** Calculate image placement, save in pl component. @param pobj Image object, must be type WXD_OT_IMAGE. */ void wxdobj_image_placement( Wxd_object_t *pobj ); /** Calculate distance from point to object. @param pobj Object to check. @param ppt Point to check. @return Distance from point to object if found, negative value otherwise. */ double wxdobj_distance_to_point( Wxd_object_t *pobj, Wxd_point_t const *ppt, bool bCtrlPt = false, uint16_t *pIndex = NULL ); /** Unmark all objects in drawing. @param pdrw Drawing to modify. @param marker Marker bit to delete from all objects. */ void wxdobj_unmark_all(Wxd_drawing_t *pdrw, uint8_t marker); /** Mark one object recursively. @param pobj Object to mark. @param marker Marker to set on object. */ void wxdobj_mark_recursively(Wxd_object_t *pobj, uint8_t marker); /** Unmark one object recursively. @param pobj Object to modify. @param marker Marker to remove from object. */ void wxdobj_unmark_recursively(Wxd_object_t *pobj, uint8_t marker); /** Find stipple structure for object. @param pdrw Drawing the object belongs to. @param pobj Object needing stipple. @return Valid pointer on success, NULL on error. */ Wxd_stipple_t * wxdobj_find_stipple_structure( Wxd_drawing_t *pdrw, Wxd_object_t *pobj ); /** Find font structure for object. @param pdrw Drawing the object belongs to. @param pobj Object needing font. @return Valid pointer on success, NULL on error. */ Wxd_font_t * wxdobj_find_font_structure( Wxd_drawing_t *pdrw, Wxd_object_t *pobj ); /** Remove unused stipple data from drawing. @param pdrw Drawing to clean up. */ void wxdobj_remove_unused_stipples( Wxd_drawing_t *pdrw ); /** Remove unused font data from drawing. @param pdrw Drawing to clean up. */ void wxdobj_remove_unused_fonts( Wxd_drawing_t *pdrw ); /** Get number of used layers in drawing. @param pdrw Drawing to check. @return Number of used layers, may be 0 for empty drawing. */ size_t wxdobj_get_number_of_layers( Wxd_drawing_t *pdrw ); /** Remove object from drawing. The object can be a simple object or a group object. When removing a group object all contents objects are removed too. @param pdrw Drawing containing the object. @param pobj Object to remove. */ void wxdobj_obj_delete_from_drawing( Wxd_drawing_t *pdrw, Wxd_object_t *pobj ); /** Shift drawing object for a difference. Call this function on members of the flat storage only. @param pobj Object to shift. @param ppt Point containing vector for shifting. @param doit Flag: Really do it (1=yes, 0=simulation/check only). @return 1 on success, 0 on error (mathematical overflow). */ int wxdobj_shift(Wxd_object_t *pobj, Wxd_point_t *ppt, int doit); /** Shift drawing objects marked by OBJ_MARKER_1 in a drawing. @param pdrw Drawing containing the objects to shift. @param ppt Point containing vector for shifting. @param doit Flag: Really do it (1=yes, 0=simulation/check only). @return 1 on success, 0 on error (mathematical overflow). */ int wxdobj_shift_marked(Wxd_drawing_t *pdrw, Wxd_point_t *ppt, int doit); /** Check whether a given marker is set on object. @param pobj Object to test. @param marker Marker to check for. @return Test result. */ bool wxdobj_is_marked(Wxd_object_t const *pobj, uint8_t marker); /** Create copy of an object. The copy is not registered to a drawing. @param psrc Object to copy, must not be a group. @return Valid pointer to new object on success, NULL on error. */ Wxd_object_t * wxdobj_copy(Wxd_object_t *psrc); /** Copy drawing object (recursively if object is a group). @param pdrw Drawing containing the object. @param pobj Drawing object, may be a group. @param psh Shift vector for the copy. @return 1 on success, 0 on error. */ int wxdobj_copy_recursive( Wxd_drawing_t *pdrw, Wxd_object_t *obj, Wxd_point_t *psh ); /** Report one object. @param pobj Object to report. */ void wxdobj_report_object( Wxd_object_t *pobj ); /** Find object and point index for point move operation. @param pdrw Drawing to search. @param ppt Mouse position. @param pindex Address of index variable to set on success. @param dlim Distance limit. @return Found object on success, NULL if no object found. */ Wxd_object_t * wxdobj_point_move_find_object( Wxd_drawing_t *pdrw, Wxd_point_t const *ppt, uint16_t *pindex, double dlim ); /** Find object and point index for spline value modification. @param pdrw Drawing to search. @param ppt Mouse position. @param pindex Address of index variable to set on success. @param dlim Distance limit. @return Found object on success, NULL if no object found. */ Wxd_object_t * wxdobj_modify_spline_find_object( Wxd_drawing_t *pdrw, Wxd_point_t const *ppt, uint16_t *pindex, double dlim ); /** Find object and point index for object rotation. @param pdrw Drawing to search. @param ppt Mouse position. @param pindex Address of index variable to set on success. @param dlim Distance limit. @return Found object on success, NULL if no object found. */ Wxd_object_t * wxdobj_rotate_find_object( Wxd_drawing_t *pdrw, Wxd_point_t const *ppt, uint16_t *pindex, double dlim ); /** Find object and point index for adding a further point. @param pdrw Drawing to search. @param ppt Mouse position. @param pindex Address of index variable to set on success. @param pbins Address of flag, whether to append after or insert before. @param dlim Distance limit. @return Found object on success, NULL if no object found. */ Wxd_object_t * wxdobj_point_add_find_object( Wxd_drawing_t *pdrw, Wxd_point_t const *ppt, uint16_t *pindex, bool *pbapp, double dlim ); /** Find object and point index for point delete operation. @param pdrw Drawing to search. @param ppt Mouse position. @param pindex Address of index variable to set on success. @param dlim Distance limit. @return Found object on success, NULL if no object found. */ Wxd_object_t * wxdobj_point_del_find_object( Wxd_drawing_t *pdrw, Wxd_point_t const *ppt, uint16_t *pindex, double dlim ); /** Retrieve control point coordinates. @param pdst Destination variable to save point coordinates. @param psrc Object to retrieve control point from. @param pind Control point index. @return True on success, false on error. */ bool wxdobj_get_control_point( Wxd_point_t *pdst, Wxd_object_t const *psrc, uint16_t pind ); /** Modify control point coordinates. @param pdst Destination object to modify control point. @param psrc New control point coordinates. @param pind Control point index. @return True on success, false on error. */ bool wxdobj_set_control_point( Wxd_object_t *pdst, Wxd_point_t const *psrc, uint16_t pind ); /** Delete one control point of polygon, polyline or spline. @param pdst Destination object to modify control points. @param pind Control point index. */ void wxdobj_delete_control_point( Wxd_object_t *pdst, uint16_t pind ); /** Add one control point to polygon, polyline or spline. @param pdst Destination object to modify control points. @param pind Control point index. @return True on success, false on error. */ bool wxdobj_add_control_point( Wxd_object_t *pdst, uint16_t pind, Wxd_point_t const *ppt ); /** Calculate distance from point to box. @param pbox Box coordinates. @param r Radius for rounded corners. @param ppt Point coordinates. @param bCtrlPt Find distance to control points, not lines. @param pIndex Address of index variable for control points. @return Distance from point ppt to box. */ double wxdobj_dist_box( Wxd_bb_t *pbox, uint32_t r, dk4_gra_point_t *ppt, bool bCtrlPt, uint16_t *pIndex ); /** Calculate distance from point to box. @param pbox Box coordinates. @param ppt Point coordinates. @param pIndex Address of index variable for control points. @param dlim Distance limit. @return True if point is near enough to control point, false otherwise. */ bool wxdobj_ctrlpt_dist_box( Wxd_bb_t *pbox, dk4_gra_point_t *ppt, uint16_t *pIndex, double dlim ); /** Set a bounding box structure with control points from an object. @param pbox Bounding box to set up. @param pobj Object to use, must be simple object (not a group). */ bool wxdobj_control_pt_to_bb( Wxd_bb_t *pbox, Wxd_object_t const *pobj ); /** Add object bounding box to another bounding box. @param pbox Accumulated bounding box information for all objects. @param psrc Bounding box information to add for one object. */ bool wxdobj_bb_add_bb( Wxd_bb_t *pbox, Wxd_bb_t const *psrc ); /** Flip one object, use collected bounding box information. @param pobj Object to flip. @param pbox Bounding box information to use. @param bVert Flip vertically (true) or horizontally (false). @param bRealRun Really flip object (false: test only). */ bool wxdobj_flip_object( Wxd_object_t *pobj, Wxd_bb_t const *pbox, bool bVert = false, bool bRealRun = true ); /** Find number of objects in structured storage marked by marker 2. @param pdrw Drawing to check. @return 0, 1 or 2 (for 2 and more). */ int wxdobj_num_marked_2(Wxd_drawing_t *pdrw); /** Find bounding box for a simple graphics element. @param pdrw Drawing containing the graphics element. @param pobj Graphics element to find bounding box for. @return True on success, false on error. */ bool wxdobj_bb_simple_object( Wxd_drawing_t const *pdrw, Wxd_object_t *pobj ); /** Rebuild bounding box for structural nodes in a group. Bounding boxes for simple objects are not renewed. @param pdrw Drawing containing the graphics element. @param pobj Graphics element to find bounding box for. @return True on success, false on error. */ bool wxdobj_bb_group_structural( Wxd_drawing_t const *pdrw, Wxd_object_t *pobj ); /** Rebuild bounding box for a group completely (both for structural nodes and simple objects. @param pdrw Drawing containing the graphics element. @param pobj Graphics element to find bounding box for. @return True on success, false on error. */ bool wxdobj_bb_group_and_contents( Wxd_drawing_t const *pdrw, Wxd_object_t *pobj ); /** Rebuild bounding box for a modified object. If the modified (moved) object is a group, rebuild the bounding box completely. If a simple object was modified, rebuild the bounding box for that object; if the object is member of a group, rebuild the groups structural bounding boxes. @param pdrw Drawing containing the graphics element. @param pobj Graphics element to find bounding box for. @return True on success, false on error. */ bool wxdobj_bb_modified_object( Wxd_drawing_t const *pdrw, Wxd_object_t *pobj ); /** (Re)build bounding box information for all drawing elements. @param pdrw Drawing to build bounding box information for. @return True on success, false on error. */ bool wxdobj_bb_for_drawing( Wxd_drawing_t *pdrw ); /** Set number of sub segments per X-spline segment. @param pdrw Drawing to set up. @param xs Number of sub segments per X-spline segment. */ void wxdobj_drw_set_xsubs(Wxd_drawing_t *pdrw, size_t xs); /** Check whether a text label object is a LaTeX text label. @param pobj Object to check. @rturn True for LaTeX text labels, false otherwise. */ bool wxdobj_text_is_latex(Wxd_object_t const *pobj); /** Check whether an object can be converted to another object type. @param destot Destination object type. @param pobj Object to check. @return True if the conversion is possible, false otherwise. */ bool wxdobj_can_convert( int destot, const Wxd_object_t *pobj ); /** Rotate an object by 90 degree. @param pobj Object to rotate. @param x0 Center point x coordinate. @param y0 Center point y coordinate. @param neg Flag: Negative direction (false=positive). @param doit Flag: Really do it (false=test only). @return True on success, false on error. */ bool wxdobj_rotate_object( Wxd_object_t *pobj, int32_t x0, int32_t y0, bool neg, bool doit ); /** Check two bounding boxes for equality. @param pa One bounding box. @param pb Other bounding box. @return True if both boxes are equal, false otherwise. */ bool wxdobj_bb_equal(Wxd_bb_t const *pa, Wxd_bb_t const *pb); /* PROTOTYPES (end) */ /* vim: set ai sw=4 ts=4 : */ #endif