gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
22 #if defined(__APPLE__)
23 #include <OpenGL/gl.h>
24 #include <OpenGL/glu.h>
30 #if defined(HAVE_VISUDEV)
31 #define NORMAL_GLTYPE GL_FLOAT
33 #define NORMAL_GLTYPE GL_BYTE
50 virtual void transform(
double &x,
double &y,
double &
z) {}
53 virtual void setMatrix(
double mat[3][3],
double tra[3]) {}
66 virtual void setMatrix(
double mat[3][3],
double tra[3] =
nullptr)
68 for(
int i = 0; i < 3; i++) {
69 for(
int j = 0; j < 3; j++)
_mat[i][j] = mat[i][j];
78 double xyz[3] = {x, y,
z};
80 for(
int k = 0; k < 3; k++) {
81 x +=
_mat[0][k] * xyz[k];
82 y +=
_mat[1][k] * xyz[k];
83 z +=
_mat[2][k] * xyz[k];
97 virtual void draw(
bool rateLimited =
true) {}
101 virtual const char *
getFontName(
int index) {
return "Helvetica"; }
104 virtual void setFont(
int fontid,
int fontsize) {}
111 virtual std::string
getName() {
return "None"; }
156 for(
int i = 0; i < 3; i++) {
162 for(
int i = 0; i < 4; i++) {
165 for(
int i = 0; i < 16; i++) {
213 GLuint &imageTexture, GLuint &imageW,
217 void setQuaternion(
double p1x,
double p1y,
double p2x,
double p2y);
218 void addQuaternion(
double p1x,
double p1y,
double p2x,
double p2y);
226 void unproject(
double winx,
double winy,
double p[3],
double d[3]);
229 bool select(
int type,
bool multiple,
bool mesh,
bool post,
int x,
int y,
230 int w,
int h, std::vector<GVertex *> &vertices,
231 std::vector<GEdge *> &
edges, std::vector<GFace *> &
faces,
232 std::vector<GRegion *> ®ions,
233 std::vector<MElement *> &elements, std::vector<SPoint2> &points,
234 std::vector<PView *> &views);
246 void drawAxis(
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
247 double zmax,
int nticks,
int mikado);
248 void drawAxes(
int mode,
double tics[3], std::string format[3],
249 std::string label[3],
double bb[6],
int mikado,
251 void drawAxes(
int mode,
double tics[3], std::string format[3],
258 void drawString(
const std::string &
s,
double x,
double y,
double z,
259 const std::string &font_name,
int font_enum,
int font_size,
260 int align,
int line_num = 0);
261 void drawString(
const std::string &
s,
double x,
double y,
double z,
267 void drawString(
const std::string &
s,
double x,
double y,
double z,
268 double style,
int line_num = 0);
269 void drawImage(
const std::string &
s,
double x,
double y,
double z,
271 void drawSphere(
double R,
double x,
double y,
double z,
int n1,
int n2,
273 void drawCube(
double x,
double y,
double z,
double val[9],
int light);
274 void drawEllipsoid(
double x,
double y,
double z,
float v0[3],
float v1[3],
275 float v2[3],
int light);
276 void drawEllipse(
double x,
double y,
double z,
float v0[3],
float v1[3],
278 void drawSphere(
double size,
double x,
double y,
double z,
int light);
279 void drawCylinder(
double width,
double *x,
double *y,
double *
z,
int light);
281 double ValMin,
double ValMax,
double *x,
double *y,
282 double *
z,
int light);
283 void drawArrow3d(
double x,
double y,
double z,
double dx,
double dy,
284 double dz,
double length,
int light);
285 void drawVector(
int Type,
int Fill,
double x,
double y,
double z,
double dx,
286 double dy,
double dz,
int light);
287 void drawBox(
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
288 double zmax,
bool labels =
true);
290 double xmax,
double ymax,
double zmax,
double a,
291 double b,
double c,
double d,
int shade = 0);
305 for(
int i = 0; i < 3; i++)
win[i] =
wnr[i] =
s[i] =
t[i] = 0.;
309 for(
int i = 0; i < 3; i++) {
312 s[i] = instance.
s[i];
313 t[i] = instance.
t[i];
318 for(
int i = 0; i < 3; i++) {
329 ctx->
t[0] + ctx->
t_init[0] / ctx->
s[0];
333 ctx->
t[1] + ctx->
t_init[1] / ctx->
s[1];
340 ctx->
t[0] =
t[0] * (
s[0] / ctx->
s[0]) -
wnr[0] * (1. - (
s[0] / ctx->
s[0]));
341 ctx->
t[1] =
t[1] * (
s[1] / ctx->
s[1]) -
wnr[1] * (1. - (
s[1] / ctx->
s[1]));
int fix2dCoordinates(double *x, double *y)
void setQuaternion(double p1x, double p1y, double p2x, double p2y)
double highResolutionPixelFactor()
virtual int getFontAlign(const char *alignstr)
void viewport2World(double vp[3], double xyz[3])
std::set< PView * > _hiddenViews
bool generateTextureForImage(const std::string &name, int page, GLuint &imageTexture, GLuint &imageW, GLuint &imageH)
double angle(const SVector3 &a, const SVector3 &b)
void drawStringCenter(const std::string &s, double x, double y, double z, int line_num=0)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
void set(drawContext *ctx, int x, int y)
std::map< std::string, imgtex > _imageTextures
virtual const char * getFontName(int index)
void drawString(const std::string &s, double x, double y, double z, const std::string &font_name, int font_enum, int font_size, int align, int line_num=0)
void drawBackgroundGradient()
virtual void setFont(int fontid, int fontsize)
void setTransform(drawTransform *transform)
virtual void drawCurrentOpenglWindow(bool make_current)
void transform(double &x, double &y, double &z)
void drawVector(int Type, int Fill, double x, double y, double z, double dx, double dy, double dz, int light)
void recenterForRotationCenterChange(SPoint3 newRotationCenter)
void transformTwoForm(double &x, double &y, double &z)
static void setGlobal(drawContextGlobal *global)
static drawContextGlobal * global()
void drawEllipsoid(double x, double y, double z, float v0[3], float v1[3], float v2[3], int light)
void addQuaternionFromAxisAndAngle(double axis[3], double angle)
virtual void draw(bool rateLimited=true)
void drawTaperedCylinder(double width, double val1, double val2, double ValMin, double ValMax, double *x, double *y, double *z, int light)
void drawPlaneInBoundingBox(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, double a, double b, double c, double d, int shade=0)
void createQuadricsAndDisplayLists()
void drawStringRight(const std::string &s, double x, double y, double z, int line_num=0)
void transformOneForm(double &x, double &y, double &z)
virtual int getFontIndex(const char *fontname)
void setQuaternionFromEulerAngles()
bool isVisible(GModel *m)
static drawContextGlobal * _global
virtual std::string getName()
static void(* drawGeomTransient)(void *)
void drawAxis(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, int nticks, int mikado)
mousePosition(const mousePosition &instance)
drawTransform * _transform
void initPosition(bool saveMatrices)
void initProjection(int xpick=0, int ypick=0, int wpick=0, int hpick=0)
void world2Viewport(double xyz[3], double vp[3])
std::set< GModel * > _hiddenModels
virtual int getStringDescent()
virtual int getFontSize()
openglWindow * _openglWindow
void drawBox(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, bool labels=true)
void setEulerAnglesFromRotationMatrix()
void unproject(double winx, double winy, double p[3], double d[3])
drawTransform * getTransform()
static void setDrawGeomTransientFunction(void(*fct)(void *))
double length(Quaternion &q)
void invalidateQuadricsAndDisplayLists()
virtual int getStringHeight()
virtual double getStringWidth(const char *str)
virtual void flushString()
void copyViewAttributes(drawContext *other)
void recenter(drawContext *ctx)
bool select(int type, bool multiple, bool mesh, bool post, int x, int y, int w, int h, std::vector< GVertex * > &vertices, std::vector< GEdge * > &edges, std::vector< GFace * > &faces, std::vector< GRegion * > ®ions, std::vector< MElement * > &elements, std::vector< SPoint2 > &points, std::vector< PView * > &views)
void buildRotationMatrix()
void drawArrow3d(double x, double y, double z, double dx, double dy, double dz, double length, int light)
void invalidateBgImageTexture()
virtual int getFontEnum(int index)
void drawCylinder(double width, double *x, double *y, double *z, int light)
drawContext(openglWindow *window=nullptr, drawTransform *transform=nullptr)
void addQuaternion(double p1x, double p1y, double p2x, double p2y)
void drawGraph2d(bool inModelCoordinates)
virtual void drawString(const char *str)
void drawBackgroundImage(bool moving)
virtual void resetFontTextures()
void drawImage(const std::string &s, double x, double y, double z, int align=0)
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
void drawEllipse(double x, double y, double z, float v0[3], float v1[3], int light)
void drawCube(double x, double y, double z, double val[9], int light)
virtual ~drawContextGlobal()