#include "appmouse.h"
#include "hotkeymap.h"
#include "polytess.h"
+#include "glcompimage.h"
+
//delta values
static float dx = 0.0;
{
- float w,h,x,y;
+ float w,h,x,y,X,Y,Z;
+ glCompImage *i;
+
if(!o->obj)
return;
- w=atof(agget(o->obj,"width"))*72;
- h=atof(agget(o->obj,"height"))*72;
if(!o->iData.data)
+ {
o->iData.data = load_png(o->op.u.image.name, &o->iData.w, &o->iData.h);
- x=o->op.u.image.pos.x;
- y=o->op.u.image.pos.y;
- x=x+(o->iData.w-w)/2.0;
- y=y+(o->iData.h-h)/2.0;
- // glRasterPos3f(x,y,5);
- glRasterPos3f(20,20,0);
- if(o->iData.data)
- glDrawPixels(o->iData.w,o->iData.h,GL_RGBA,GL_UNSIGNED_BYTE,o->iData.data);
+ x=o->op.u.image.pos.x;
+ y=o->op.u.image.pos.y;
+ i = glCompImageNew(NULL, x, y);
+ glCompImageLoadPng(i, o->op.u.image.name,0);
+ i->common.functions.draw(i);
+
+ }
+
+
}
void EmbedText(sdot_op* o, int param)
{
p->shadowwidth = 0;
i = glCompImageNew((glCompObj *) p, 0, 0);
- glCompImageLoadPng(i, smyrnaPath("mod_fisheye.png"));
+ glCompImageLoadPng(i, smyrnaPath("mod_fisheye.png"),1);
imgFisheye = i;
i->common.visible = 0;
i = glCompImageNew((glCompObj *) p, 0, 52);
- glCompImageLoadPng(i, smyrnaPath("mod_3D.png"));
+ glCompImageLoadPng(i, smyrnaPath("mod_3D.png"),1);
img3D = i;
i->common.visible = 0;
-/* l=glCompLabelNew((glCompObj *)s,100,5,view->Topview->Graphdata.GraphFileName);
- glCompLabelSetFontSize(l,24);*/
+
-// testContainer(s);
return s;
RelativePath=".\draw.c"
>
</File>
- <File
- RelativePath=".\drawxdot.c"
- >
- </File>
<File
RelativePath=".\filter.c"
>
</File>
- <File
- RelativePath=".\gui\filterscallbacks.c"
- >
- </File>
<File
RelativePath=".\gui\frmobjectui.c"
>
RelativePath=".\smyrna_utils.c"
>
</File>
- <File
- RelativePath=".\template.c"
- >
- </File>
<File
RelativePath=".\gui\toolboxcallbacks.c"
>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
- ShowAllFiles="true"
+ ShowAllFiles="false"
>
<Configurations>
<Configuration
Attach="false"
DebuggerType="3"
Remote="1"
- RemoteMachine="YEHUDA"
+ RemoteMachine="DT-BYUNG"
RemoteCommand=""
HttpUrl=""
PDBPath=""
>
<DebugSettings
Command="$(TargetPath)"
- WorkingDirectory="C:\graphviz-ms\bin"
- CommandArguments="c:/4elt.dot"
+ WorkingDirectory=""
+ CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
- RemoteMachine="YEHUDA"
+ RemoteMachine="DT-BYUNG"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
- DebuggerFlavor="0"
+ DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
/*image on left for now */
b->image = glCompImageNew((glCompObj *) b, 0, 0);
- rv = glCompImageLoadPng(b->image, fileName);
+ rv = glCompImageLoadPng(b->image, fileName,1);
if (rv) {
b->image->common.anchor.leftAnchor = 1;
b->image->common.anchor.left = 0;
extern unsigned char *load_png(char *file_name, int *imageWidth,
int *imageHeight);
int glCompImageLoad(glCompImage * i, unsigned char *data, int width,
- int height)
+ int height,int is2D)
{
if (data != NULL) { /*valid image data */
glCompDeleteTexture(i->texture);
i->texture =
glCompSetAddNewTexImage(i->common.compset, width, height, data,
- 1);
+ is2D);
if (i->texture) {
i->common.width = width;
i->common.height = height;
-int glCompImageLoadPng(glCompImage * i, char *pngFile)
+int glCompImageLoadPng(glCompImage * i, char *pngFile,int is2D)
{
int imageWidth, imageHeight;
unsigned char *data;
data = load_png(pngFile, &imageWidth, &imageHeight);
- return glCompImageLoad(i, data, imageWidth, imageHeight);
+ return glCompImageLoad(i, data, imageWidth, imageHeight,is2D);
}
-int glCompImageLoadRaw(glCompSet * s, glCompImage * i, char *rawFile)
+int glCompImageLoadRaw(glCompSet * s, glCompImage * i, char *rawFile,int is2D)
{
int imageWidth, imageHeight;
unsigned char *data;
data = load_png(rawFile, &imageWidth, &imageHeight);
- return glCompImageLoad(i, data, imageWidth, imageHeight);
+ return glCompImageLoad(i, data, imageWidth, imageHeight,is2D);
}
void glCompImageDraw(void *obj)
{
glCompImage *p;
static glCompCommon ref;
-// static GLfloat w,h,d;
+ static GLfloat w,h,d;
p = (glCompImage *) obj;
ref = p->common;
glCompCalcWidget((glCompCommon *) p->common.parent, &p->common, &ref);
if (!p->texture)
return;
- glRasterPos2f(ref.pos.x, ref.pos.y);
-// glPixelZoom(2,2);
- glDrawPixels(p->texture->width, p->texture->height, GL_RGBA,
- GL_UNSIGNED_BYTE, p->texture->data);
+ if(p->texture->id <=0)
+ {
+ glRasterPos2f(ref.pos.x, ref.pos.y);
+ glDrawPixels(p->texture->width, p->texture->height, GL_RGBA,GL_UNSIGNED_BYTE, p->texture->data);
+ }
+ else
+ {
-/* w=ref.width;
+ w=ref.width;
h=ref.height;
d=(GLfloat)p->common.layer* (GLfloat)GLCOMPSET_BEVEL_DIFF;
- glDisable(GL_BLEND);
+ glDisable(GL_BLEND);
glEnable(GL_TEXTURE_2D);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glBindTexture(GL_TEXTURE_2D,p->texture->id);
glTexCoord2d(0.0f, 0.0f);glVertex3d(ref.pos.x,ref.pos.y+h,d);
glEnd();
+
glDisable(GL_TEXTURE_2D);
- glEnable(GL_BLEND);*/
+ glEnable(GL_BLEND);
+ }
}
GLfloat y);
extern void glCompImageDelete(glCompImage * p);
extern int glCompImageLoad(glCompImage * i, unsigned char *data,
- int width, int height);
- extern int glCompImageLoadPng(glCompImage * i, char *pngFile);
+ int width, int height,int is2D);
+ extern int glCompImageLoadPng(glCompImage * i, char *pngFile,int is2D);
extern void glCompImageDraw(void *obj);
extern void glCompImageClick(glCompObj * o, GLfloat x, GLfloat y,
glMouseButtonType t);
t->userCount = 1;
t->width = (GLfloat) width;
t->height = (GLfloat) height;
- s->textureCount++;
- s->textures =
+ if(s)
+ {
+ s->textureCount++;
+ s->textures =
realloc(s->textures, s->textureCount * sizeof(glCompTex *));
- s->textures[s->textureCount - 1] = t;
+ s->textures[s->textureCount - 1] = t;
+ }
return t;
GLfloat borderWidth;
ref->height = child->height;
ref->width = child->width;
+ if(!parent)
+ {
+ child->refPos.x = child->pos.x;
+ child->refPos.y = child->pos.y;
+ return;
+ }
if (parent->borderType == glBorderNone)
borderWidth = 0;
else