UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ZtColoredMatrix Class Reference

#include <ZtColoredMatrix.H>

Inheritance diagram for ZtColoredMatrix:
ZtObject ZScaledPalette ZDrawable ZRect ZPalette ZGEnv ZPoint ZSize ZConnect ZConnect

Public Member Functions

 ZtColoredMatrix (ZtMain *pManager, ZGroupId pxid, ZGroupId pyid, ZGroupId nxid, ZGroupId nyid)
 
virtual ~ZtColoredMatrix ()
 
void attach_xc (unsigned xc_n, float *pXC)
 
void attach_xc (unsigned xc_n, float x0, float dx)
 
void attach_yc (unsigned yc_n, float *pYC)
 
void attach_yc (unsigned yc_n, float y0, float dy)
 
void attach_matrix (ZDimension storage_policy, float *pMatrix)
 
void attach_matrix (ZCMatixAccess pFunc, void *pCustomData=NULL)
 
void detach_matrix ()
 
Logic get_status_of_matrix () const
 
void set_fill_mode (ZtvFillMode fm)
 
ZtvFillMode get_fill_mode () const
 
virtual void redraw ()
 
virtual ZInputStatus input (const XEvent *xev)
 
virtual const char * class_id () const
 
- Public Member Functions inherited from ZtObject
 ZtObject (ZtMain *pManager, ZGroupId pxid, ZGroupId pyid)
 
 ZtObject (ZtMain *pManager, ZGroupId pxid, ZGroupId pyid, ZDimension dim, ZGroupId nid)
 
 ZtObject (ZtMain *pManager, ZGroupId pxid, ZGroupId pyid, ZGroupId nxid, ZGroupId nyid)
 
 ZtObject (const ZtObject &zobj)
 
ZtMainget_manager () const
 
virtual void prepare_xywh ()
 
ZNCoordSlavenx () const
 
ZNCoordSlaveny () const
 
Logic is_vertical () const
 
Logic is_horizontal () const
 
float x_p2n (int pcoord) const
 
float y_p2n (int pcoord) const
 
int x_n2p (float ncoord) const
 
int y_n2p (float ncoord) const
 
Logic clip_line_by_rect (float sx[2], float sy[2]) const
 
Logic clip_line_by_rect (int sx[2], int sy[2]) const
 
Logic clip_line_by_rect (float sx[2], float sy[2], float nx[2], float ny[2]) const
 
Logic clip_line_by_rect (float sx[2], float sy[2], int px[2], int py[2]) const
 
Logic clip_rect_by_rect (float rcx[2], float rcy[2]) const
 
Logic clip_rect_by_rect (float rx[2], float ry[2], float cx[2], float cy[2]) const
 
void seldom_redraw (Logic flag)
 
Logic is_seldom_redraw () const
 
void changes ()
 
void done ()
 
Logic is_changed () const
 
virtual void extent_rect (ZRect &res)
 
virtual void expose ()
 
virtual void can_hear_events (Logic flag)
 
Logic is_deaf () const
 
virtual void show ()
 
virtual void hide ()
 
Logic is_hidden () const
 
virtual Logic belong (int px, int py) const
 
void raise_exch ()
 
void raise_shift ()
 
void wePutMsg (int elevel, const char *s)
 
void weFormatMsg (int elevel, const char *format,...)
 
void put_msg (int elevel, const char *format, va_list val)
 
void format_msg (int elevel, const char *format,...)
 
void set_info_lines (InfoLine *il)
 
InfoLineget_info_lines () const
 
- Public Member Functions inherited from ZDrawable
 ZDrawable (const ZConnect &zconnect, Drawable drawable)
 
 ZDrawable (const ZDrawable &zdrawable)
 
virtual ZRect rect () const
 
void draw_text (int x, int y, int attachment, const char *szText) const
 
void draw_text (const ZRect &box, int alignment, const char *szText) const
 
void write_tiff (const char *path, ZmImageRemarks *remarks=NULL)
 
void write_png (const char *path, ZmImageRemarks *remarks=NULL)
 
- Public Member Functions inherited from ZGEnv
 ZGEnv (const ZConnect &zconnect)
 
 ZGEnv (const ZGEnv &zgenv)
 
void set_foreground (const char *szColorName)
 
void set_foreground (ColorPixel cp)
 
ColorPixel get_foreground () const
 
const char * get_foreground_name () const
 
void set_background (const char *szColorName)
 
void set_background (ColorPixel cp)
 
ColorPixel get_background () const
 
const char * get_background_name () const
 
void swap_ground ()
 
void assign (const ZGEnv &zgenv)
 
void set_line_width (int new_width)
 
int get_line_width () const
 
void set_line_style (int new_style, int dash=3, int hole=3)
 
int get_line_style () const
 
void set_font (const char *szFontName)
 
void set_font_as (const ZGEnv &zgenv)
 
Font get_font () const
 
const char * get_font_name () const
 
int text_width (const char *szText) const
 
int text_width (int n) const
 
int text_height () const
 
int text_ascent () const
 
int text_descent () const
 
ZRect text_rect (int x, int y, int attachment, const char *szText) const
 
virtual void changed_state (int mask_of_changes)
 
ZGEnvoperator= (const ZGEnv &zgenv)
 
- Public Member Functions inherited from ZConnect
 ZConnect (Display *display)
 
 ZConnect (const ZConnect &zconnect)
 
void flush ()
 
void x_error (int code) const
 
ZRect rect (Drawable drawable) const
 
int depth (Drawable drawable) const
 
Window root_wid () const
 
ColorPixel white () const
 
ColorPixel black () const
 
ColorPixel color (const char *szColorName) const
 
- Public Member Functions inherited from ZRect
 ZRect (const ZPoint &zpoint1, const ZPoint &zpoint2)
 
 ZRect (const ZPoint &zpoint, const ZSize &zsize, ZCorner zcorner=zcLeftTop)
 
 ZRect (const ZRect &zrect)
 
virtual void move (const ZPoint &zpoint, ZCorner zcorner=zcLeftTop)
 
virtual Logic inside (const ZPoint &zpoint) const
 
virtual operator XRectangle () const
 
void print (const char *szEnd="\n") const
 
bool operator== (const ZRect &zrect) const
 
bool operator!= (const ZRect &zrect) const
 
- Public Member Functions inherited from ZPoint
 ZPoint (int x_coord, int y_coord)
 
 ZPoint (const ZPoint &zpoint)
 
 operator XPoint () const
 
void add_offset (const ZSize &zsize)
 
void sub_offset (const ZSize &zsize)
 
void print (const char *szEnd="\n") const
 
bool operator== (const ZPoint &zpoint) const
 
bool operator!= (const ZPoint &zpoint) const
 
- Public Member Functions inherited from ZSize
 ZSize (int width, int height)
 
 ZSize (const ZSize &zsize)
 
void difference (const ZPoint &zpoint1, const ZPoint &zpoint2)
 
void print (const char *szEnd="\n") const
 
bool operator== (const ZSize &zsize) const
 
bool operator!= (const ZSize &zsize) const
 
- Public Member Functions inherited from ZScaledPalette
 ZScaledPalette (const ZConnect &zconnect)
 
 ZScaledPalette (const ZPalette &zpal)
 
 ZScaledPalette (const ZScaledPalette &zpal)
 
unsigned coord_to_index (float coord) const
 
void index_to_coord_range (unsigned index, float coord[2]) const
 
void get_scale (FloatAr &scale)
 
ColorPixel color (float coord) const
 
const char * color_name (float coord) const
 
ColorPixel & fetch_color (float coord)
 
ColorPixel & operator[] (float coord)
 
virtual void remove_color (float coord)
 
void scale_assign (const FloatAr &scale)
 
void scale_equal_range (float mm[2])
 
virtual void add_color (ColorPixel theColorPixel)
 
virtual void insert_color (unsigned index, ColorPixel theColorPixel)
 
virtual void remove_color (unsigned index)
 
virtual void reset_colors ()
 
virtual void revert_order ()
 
- Public Member Functions inherited from ZPalette
 ZPalette (const ZConnect &zconnect)
 
 ZPalette (const ZPalette &zpal)
 
virtual ~ZPalette ()
 
virtual void set_smooth_rate (int n=100)
 
virtual void load_palette (const char *szPalName)
 
virtual void append_palette (const char *szPalName)
 
virtual void add_color (const char *szColorName)
 
virtual void add_color (float rgb[3])
 
virtual void insert_color (unsigned index, const char *szColorName)
 
virtual void insert_color (unsigned index, float rgb[3])
 
unsigned colors_count () const
 
ColorPixel color (unsigned index) const
 
const char * color_name (unsigned index) const
 
ColorPixel & fetch_color (unsigned index)
 
ColorPixel & operator[] (unsigned index)
 
Pixmap draw_palette (const ZSize &zs, Logic bReverse=FALSE, ZDimension dim=zdHorizontal) const
 

Protected Member Functions

float get_height (unsigned xi, unsigned yi)
 
Logic find_cell (unsigned &xi, unsigned &yi, float x, float y, float x_pr=0.0, float y_pr=0.0) const
 
void draw_pixel (unsigned xpi, unsigned ypi)
 
- Protected Member Functions inherited from ZGEnv
void draw_text (Drawable id, int x, int y, int attachment, const char *szText) const
 
void draw_text (Drawable id, const ZRect &box, int alignment, const char *szText) const
 

Static Protected Member Functions

static void prepare_pixel_list (const ZNCoordSlave &ns, const ZPCoordSlave &ps, const FloatAr &car, ZtCMPixelItemAr &piar)
 
static Logic in_range (Logic ascent, float c1, float c, float c2)
 
static float restrict_range (Logic ascent, float c1, float c, float c2)
 

Protected Attributes

float * matrix
 
ZCMatixAccess mafunc
 
void * mafptr
 
ZDimension stpol
 
FloatAr xc
 
FloatAr yc
 
ZtvFillMode fill_mode
 
float x_prec
 
float y_prec
 
ZtCMPixelItemAr xpiar
 
ZtCMPixelItemAr ypiar
 
ZBarDrawfdm
 
- Protected Attributes inherited from ZtObject
InfoLinepInfoLine
 
ZNCoordSlavepnx
 
ZNCoordSlavepny
 
ZtMainmanager
 
- Protected Attributes inherited from ZScaledPalette
FloatAr rb
 
- Protected Attributes inherited from ZPalette
int nSmooth
 

Additional Inherited Members

- Public Attributes inherited from ZtObject
ZPCoordSlave px
 
ZPCoordSlave py
 
float belong_eps
 
- Public Attributes inherited from ZDrawable
Drawable did
 
- Public Attributes inherited from ZGEnv
GC gc
 
XFontStruct * font
 
- Public Attributes inherited from ZConnect
Display * dpy
 
ScreenNo scr_no
 
- Public Attributes inherited from ZPoint
int x
 
int y
 
- Public Attributes inherited from ZSize
int w
 
int h
 

Detailed Description

Object for colored matrix visualization. An item of the matrix is a "height" which is colored by assigned scaled palette.

Constructor & Destructor Documentation

ZtColoredMatrix::ZtColoredMatrix ( ZtMain pManager,
ZGroupId  pxid,
ZGroupId  pyid,
ZGroupId  nxid,
ZGroupId  nyid 
)

Colored matrix constructor.

virtual ZtColoredMatrix::~ZtColoredMatrix ( )
virtual

Destructor.

Member Function Documentation

void ZtColoredMatrix::attach_matrix ( ZDimension  storage_policy,
float *  pMatrix 
)

Attach matrix itself; zdHorizontal means by row item storage policy (a-la C); zdVertical means by column item storage policy (a-la Fortran).

void ZtColoredMatrix::attach_matrix ( ZCMatixAccess  pFunc,
void *  pCustomData = NULL 
)

Attach matrix itself by general access method

void ZtColoredMatrix::attach_xc ( unsigned  xc_n,
float *  pXC 
)

Attach x coordinates vector.

void ZtColoredMatrix::attach_xc ( unsigned  xc_n,
float  x0,
float  dx 
)

Attach equally positioned x coordinates vector.

void ZtColoredMatrix::attach_yc ( unsigned  yc_n,
float *  pYC 
)

Attach y coordinates vector

void ZtColoredMatrix::attach_yc ( unsigned  yc_n,
float  y0,
float  dy 
)

Attach equally positioned y coordinates vector.

virtual const char* ZtColoredMatrix::class_id ( ) const
virtual

Self-identification.

Reimplemented from ZtObject.

void ZtColoredMatrix::detach_matrix ( )

Detach matrix and disable drawing

void ZtColoredMatrix::draw_pixel ( unsigned  xpi,
unsigned  ypi 
)
protected

Draw one pointed pixel from pixel array.

Logic ZtColoredMatrix::find_cell ( unsigned &  xi,
unsigned &  yi,
float  x,
float  y,
float  x_pr = 0.0,
float  y_pr = 0.0 
) const
protected

Find cell which contains given (x,y) point or return FALSE

ZtvFillMode ZtColoredMatrix::get_fill_mode ( ) const

Get actual fill mode

float ZtColoredMatrix::get_height ( unsigned  xi,
unsigned  yi 
)
protected

Abstract matrix access method

Logic ZtColoredMatrix::get_status_of_matrix ( ) const

Get status of data matrix.

static Logic ZtColoredMatrix::in_range ( Logic  ascent,
float  c1,
float  c,
float  c2 
)
staticprotected

Return TRUE if c is in range [c1,c2].

virtual ZInputStatus ZtColoredMatrix::input ( const XEvent *  xev)
virtual

Click is converted to (xi,yi) and detailed information about the height

Reimplemented from ZtObject.

static void ZtColoredMatrix::prepare_pixel_list ( const ZNCoordSlave ns,
const ZPCoordSlave ps,
const FloatAr car,
ZtCMPixelItemAr &  piar 
)
staticprotected

Prepare list of pixels without duplicates and holes which elapses the whole get_pc() range and each pixel will have exact natural cell where it resides.

virtual void ZtColoredMatrix::redraw ( )
virtual

Direct draw procedure: if size, place or parameters are changed

Reimplemented from ZtObject.

static float ZtColoredMatrix::restrict_range ( Logic  ascent,
float  c1,
float  c,
float  c2 
)
staticprotected

Return coordinate restricted to the current cell.

void ZtColoredMatrix::set_fill_mode ( ZtvFillMode  fm)

Setup fill mode

Member Data Documentation

ZBarDraw* ZtColoredMatrix::fdm
protected

Fast drawing method

ZtvFillMode ZtColoredMatrix::fill_mode
protected

Fill mode: contour, semi-contour (+/-), opaque

void* ZtColoredMatrix::mafptr
protected

custom pointer in mafunc

ZCMatixAccess ZtColoredMatrix::mafunc
protected

matrix access function or NULL

float* ZtColoredMatrix::matrix
protected

data matrix or NULL

ZDimension ZtColoredMatrix::stpol
protected

storage policy: zdHor(c), zdVer(fortran)

float ZtColoredMatrix::x_prec
protected

Precision of point-to-cell residence rule - depends on current nc/pc scaling factor

ZtCMPixelItemAr ZtColoredMatrix::xpiar
protected

List of horizontal pixels with associated data

FloatAr ZtColoredMatrix::yc
protected

2 dimension of arguments

ZtCMPixelItemAr ZtColoredMatrix::ypiar
protected

List of vertical pixels with associated data


The documentation for this class was generated from the following file: