📄 output.h
字号:
//**************************************************************//* filename: output.h *//* *//**************************************************************//* programmed by: Thomas Wagner *//* last change: (XXX: not updated) *//**************************************************************#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>class Output;class Output2d_3d;class InOutput;class ClusterOutput;class RuleOutput;class ClassifyOutput;class RuleResultInfo;#ifndef OUTPUT_H#define OUTPUT_H#include "window.h"#include "selectwindow.h"#include "scroll.h"#include "menu.h"#include "moveicon.h"#include "onofficon.h"#include "selecticon.h"#include "ellipses.h"#include "memberout.h"// including from Olli#include "daten.h"#include "cluster.h"#include "vektor.h"#define BUTTON1PRESSED (1<<0)#define BUTTON2PRESSED (1<<1)#define BUTTON3PRESSED (1<<2)#define VIEWICON_SIZE 14//define for ClassifyOutput.status/RuleOutput.statusenum OUTPUTSTATUS { OUTPUT_NOWORKSTATUS, OUTPUT_WORKASSINGLEPOINTCALCULATOR, OUTPUT_WORKASALLPOINTSCALCULATOR};// use in rule-drawing:#define RULE_VERT_SPACE 30#define SPACE_BETWEEN_IN_AND_OUT 60#define RULE_BORDER 20#define RULE_MINDRAWWIDTH 50#define RULE_MINDRAWHEIGHT 30#define RULE_ARROWLENGTHMULT 0.1#define RULE_ARROWWIDTHMULT 0.03#define RULE_VALUELENGTH 10// use in classify-drawing:#define CLASSIFY_VERT_SPACE 30#define CLASSIFY_HORI_SPACE 10#define CLASSIFY_RESULTSPACE 55#define CLASSIFY_BORDER 20#define CLASSIFY_MINDRAWWIDTH 50#define CLASSIFY_MINDRAWHEIGHT 30//enum for Cluster.axismenuenum OUTPUTACTIONS { OUTPUT_CHANCEINDEX1_ACTION, OUTPUT_CHANCEINDEX2_ACTION, OUTPUT_CHANCEINDEX3_ACTION, //define for InOutput/ClusterOutput.viewicons OUTPUT_VIEW2D_SELECT, OUTPUT_VIEW3D_SELECT, OUTPUT_VIEW2DCLASSMEMBERSHIP_SELECT, OUTPUT_VIEW3DCLASSMEMBERSHIP_SELECT, OUTPUT_SINGLEMEMBERSHIP_SELECT, OUTPUT_VIEW2DMEMBERTYP1_SELECT, OUTPUT_VIEW3DMEMBERTYP1_SELECT, OUTPUT_VIEW2DMEMBERTYP2_SELECT, OUTPUT_VIEW3DMEMBERTYP2_SELECT, OUTPUT_VIEW2DGUETE_SELECT, OUTPUT_CHANCEDATAINDEX_ACTION, OUTPUT_CLASSIFIED, OUTPUT_REDRAW, OUTPUT_REDRAWTOWINDOW, OUTPUT_RESIZED, OUTPUT_STARTCLUSTERING_ACTION, OUTPUT_RESETCLUSTERING_ACTION, OUTPUT_CREATERULES_ACTION, OUTPUT_RULESSELECTION_FINISHED, OUTPUT_CLASSIFY_ACTION, OUTPUT_CLASSIFYSELECTION_FINISHED, OUTPUT_DISPLAYCLUSTEROPTIONS_ACTION, OUTPUT_SAVE, OUTPUT_SAVEOK, OUTPUT_LOAD, OUTPUT_RELOADOK, OUTPUT_LOADOK, //define for InOutput.resultdisplaytyp OUTPUT_DRAWONLYRESULT_SELECT, OUTPUT_DRAWONLYORIGINAL_SELECT, OUTPUT_DRAWBOTH_SELECT, //define for ClusterOutput OUTPUT_CLUSTEROPTION_OK, //define for ClusterOutput.Clustericons OUTPUT_CLUSTERTYPELLIPSIS_SELECT, OUTPUT_CLUSTERTYPSYMBOL_SELECT, OUTPUT_CLUSTERTYPSTAR_SELECT, OUTPUT_CLUSTERTYPCOLOR_SELECT, OUTPUT_POINTTYPPOINT, OUTPUT_POINTTYPCROSS, OUTPUT_POINTTYPCLASSES, OUTPUT_POINTTYPCOLOR, OUTPUT_DATASETMODIFIED, //define for ClusterOutput.actionselecticons OUTPUTSTATUS_CREATECLUSTER_SELECT, OUTPUTSTATUS_MOVECLUSTER_SELECT, OUTPUTSTATUS_DESTROYCLUSTER_SELECT, OUTPUTSTATUS_SELECTCLUSTER_SELECT, //define for InOutput/ClusterOutput.actionselecticons OUTPUTSTATUS_ROLL, OUTPUTSTATUS_MOVE, OUTPUT_FITSCALE, //define for InOutput.actionselecticons OUTPUTSTATUS_MOVEPOINT, OUTPUTSTATUS_SELECTPOINT, OUTPUTSTATUS_CREATEPOINT, OUTPUTSTATUS_DELETEPOINT, OUTPUT_CHANCECLASSINDEX_ACTION, //define for RuleOutput::Action OUTPUT_CHANCEINDEX_ACTION, OUTPUT_ICONREQUESTFORRULERESULTINFO, OUTPUT_ICONLOSTINPUTCONNECTION, OUTPUT_SAVEOBJECT, //define for ClassifyOutput::Action OUTPUT_CLASSIFYNEW, //define for Output::Action OUTPUT_GHOST};// use in 3d-view:#define DEFAULT_EYEDISTANCE 3.0#define ARROWLENGTHMULT 0.06#define ARROWWIDTHMULT 0.015#define CROSSWIDTH 2#define CLUSTERCROSSWIDTH 4#define SYMBOLHALFWIDTH 4#define SYMBOLNUMBER 12#define ANGLEPERPIXEL 0.03 // used to rotate axes#define MOVEFACTOR 0.02 // used to move axes#define DEFAULTXINDEX 0#define DEFAULTYINDEX 1#define DEFAULTZINDEX 2// use in 2d-view:#define ARROWOVERLAP 1.1#define OUTPUTBORDERWIDTH 30#define OUTPUTMINSIZE 300#define DOUBLECLICKTIME 300#define ERASEOLDDRAWING (1<<0)#define DRAWINWINDOW (1<<1)#define DRAWTEMP (1<<2) //invert pixmap#define DRAWMARKED (1<<3)#define DRAWGREY (1<<4)// used by Calculate3dparameter#define RESET_AXES (1<<0)#define CENTER_AXES (1<<1)class RuleResultInfo{ public: DVektorArray * result; Datensatz *dataset; RuleResultInfo (Datensatz * Dataset = NULL); ~RuleResultInfo (); void operator = (RuleResultInfo & source);};class Output: public BigWindow{ protected: ActionIcon * ghost; MoveableIcon *myicon; Pixmap pixmap; Datensatz *Dataset; public: Output (Display * initdisplay, // the display GC initgc, // the gc MoveableIcon * initOutputicon, XFontStruct * fontstruct, // the fontstruct int initx, int inity, // X-Pos, Y-Pos int initwidth, int initheight, // width, height char *text); // window-title virtual ~ Output (); virtual void SetDataset (Datensatz * inputDataset) = NULL; virtual void MapMe (); virtual Datensatz *GetDataset () = NULL; void UpdateOutput (); /* save the bitmap of the window to a file: */ void DumpBitmap ();#if 1 /* XXX: */ void Resized (int newwidth, int newheight);#endif protected:#if 0 /* XXX: */ void Resized (int newwidth, int newheight);#endif void ClearPixmap (); void DrawSymbol (short xpos, short ypos, Drawable drawable, int symbolindex); void DrawColorbox (short xpos, short ypos, Drawable drawable, int symbolindex); void DrawBox (short xpos, short ypos, Drawable drawable); void UnDrawBox (short xpos, short ypos, Drawable drawable);};class Output2d: public Output{ protected: Menu ** indexmenues; short menunumber; IVektor graphxpos, // positions between graphypos; // the different graphes public: Output2d (Display * initdisplay, // the display GC initgc, // the gc MoveableIcon * initOutputicon, XFontStruct * fontstruct, // the fontstruct int initx, int inity, // X-Pos, Y-Pos int initwidth, int initheight, // width, height char *text); // window-title virtual ~ Output2d () {; } protected: void DrawGraph (Parameter * parameter, int xpos, int ypos, int drawwidth, int drawheight, double range, double minxvalue);};class Output2d_3d: public Output{ friend class Ellipsis_3d; friend class Ellipsis_2d; protected: double float_to_pixel; // used for 2d-View short centerx, centery; // used for 2d-View Pixel of (0,0) float axisframe[3][4]; // used for 3d-View double scalefactor, eyedistance; // for 3d-View unsigned short xindex, yindex, zindex; short xcenter, ycenter; // for 3d-View // center of window Menu *axismenu; DVektor deepvalues; IVektor deepindex; OnOffIcon *fitscaleicon; double xscale, yscale, zscale; public: Output2d_3d (Display * initdisplay, // the display GC initgc, // the gc MoveableIcon * initOutputicon, XFontStruct * fontstruct, // the fontstruct int initx, int inity, // X-Pos, Y-Pos int initwidth, int initheight, // width, height char *text); // window-title virtual ~ Output2d_3d () { ; } /* XXX: */ void Resized (int newwidth, int newheight); void InitOutput (DVektorArray * inputData);protected: void Calculate_scale_2d (DVektorArray * inputData); void Calculate_scale_2d (double xsize); void Calculate_scale_2d (double xsize, double ysize); void Calculate_scale_3d (double xsize, double ysize); void Calculate_scale_3d (double xsize, double ysize, double zsize); void Calculate2dparameter (double xmin, double ymin, double xmax, double ymax); void Calculate2dparameter (DVektorArray * inputData); void Calculate3dparameter (char options); void DrawCoordinates (short xpos, short ypos); inline void PixeltoWorld1d (short xpos, short ypos, int *number, double *xis); inline void WorldtoPixel1d (short number, double xpos, short *xis, short *yis);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -