Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-21 02:21:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-21 02:21:33 +0300
commit4530b4984cc0bee1e67115c883dfaa98076832a9 (patch)
tree262d2d0b44ad866d8c2f2f16285779e9fb2eb231
parent9cdf00897a7b3a32494cbc7b4004ee67447a6f4e (diff)
use uppercase for axis chars, used in BLI_math and other parts of blender.
-rw-r--r--source/blender/editors/transform/transform_manipulator.c62
1 files changed, 32 insertions, 30 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 238f53cbb87..ca106c0e88a 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -708,7 +708,7 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned c
}
else {
switch(axis) {
- case 'c':
+ case 'C':
UI_GetThemeColor3ubv(TH_TRANSFORM, col);
if(v3d->twmode == V3D_MANIP_LOCAL) {
col[0]= col[0]>200?255:col[0]+55;
@@ -721,17 +721,19 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned c
col[2]= col[2]<55?0:col[2]-55;
}
break;
- case 'x':
+ case 'X':
col[0]= 220;
break;
- case 'y':
+ case 'Y':
col[1]= 220;
break;
- case 'z':
+ case 'Z':
col[0]= 30;
col[1]= 30;
col[2]= 220;
break;
+ default:
+ BKE_assert(!"invalid axis arg");
}
}
@@ -744,7 +746,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
/* axes */
if(flagx) {
- manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+ manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X);
else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X);
glBegin(GL_LINES);
@@ -755,7 +757,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
if(flagy) {
if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y);
else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y);
- manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+ manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
glBegin(GL_LINES);
glVertex3f(0.0f, 0.2f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
@@ -764,7 +766,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
if(flagz) {
if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z);
else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z);
- manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+ manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.2f);
glVertex3f(0.0f, 0.0f, 1.0f);
@@ -893,7 +895,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
/* axis */
if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) {
preOrthoFront(ortho, rv3d->twmat, 2);
- manipulator_setcolor(v3d, 'x', colcode, 255);
+ manipulator_setcolor(v3d, 'X', colcode, 255);
glBegin(GL_LINES);
glVertex3f(0.2f, 0.0f, 0.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
@@ -902,7 +904,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
}
if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) {
preOrthoFront(ortho, rv3d->twmat, 0);
- manipulator_setcolor(v3d, 'y', colcode, 255);
+ manipulator_setcolor(v3d, 'Y', colcode, 255);
glBegin(GL_LINES);
glVertex3f(0.0f, 0.2f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
@@ -911,7 +913,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
}
if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) {
preOrthoFront(ortho, rv3d->twmat, 1);
- manipulator_setcolor(v3d, 'z', colcode, 255);
+ manipulator_setcolor(v3d, 'Z', colcode, 255);
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.2f);
glVertex3f(0.0f, 0.0f, 1.0f);
@@ -928,7 +930,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(drawflags & MAN_ROT_Z) {
preOrthoFront(ortho, matt, 2);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor(v3d, 'z', colcode, 255);
+ manipulator_setcolor(v3d, 'Z', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
postOrtho(ortho);
}
@@ -937,7 +939,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, matt, 0);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor(v3d, 'x', colcode, 255);
+ manipulator_setcolor(v3d, 'X', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
glRotatef(-90.0, 0.0, 1.0, 0.0);
postOrtho(ortho);
@@ -947,7 +949,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, matt, 1);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor(v3d, 'y', colcode, 255);
+ manipulator_setcolor(v3d, 'Y', colcode, 255);
drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
glRotatef(90.0, 1.0, 0.0, 0.0);
postOrtho(ortho);
@@ -963,7 +965,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(drawflags & MAN_ROT_Z) {
preOrthoFront(ortho, rv3d->twmat, 2);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor(v3d, 'z', colcode, 255);
+ manipulator_setcolor(v3d, 'Z', colcode, 255);
partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
postOrtho(ortho);
}
@@ -972,7 +974,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 0);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor(v3d, 'x', colcode, 255);
+ manipulator_setcolor(v3d, 'X', colcode, 255);
partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
glRotatef(-90.0, 0.0, 1.0, 0.0);
postOrtho(ortho);
@@ -982,7 +984,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 1);
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor(v3d, 'y', colcode, 255);
+ manipulator_setcolor(v3d, 'Y', colcode, 255);
partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
glRotatef(90.0, 1.0, 0.0, 0.0);
postOrtho(ortho);
@@ -998,7 +1000,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 2);
glPushMatrix();
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor(v3d, 'z', colcode, 255);
+ manipulator_setcolor(v3d, 'Z', colcode, 255);
partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
@@ -1011,7 +1013,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 1);
glPushMatrix();
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
- manipulator_setcolor(v3d, 'y', colcode, 255);
+ manipulator_setcolor(v3d, 'Y', colcode, 255);
glRotatef(90.0, 1.0, 0.0, 0.0);
glRotatef(90.0, 0.0, 0.0, 1.0);
@@ -1026,7 +1028,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
preOrthoFront(ortho, rv3d->twmat, 0);
glPushMatrix();
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
- manipulator_setcolor(v3d, 'x', colcode, 255);
+ manipulator_setcolor(v3d, 'X', colcode, 255);
glRotatef(-90.0, 0.0, 1.0, 0.0);
glRotatef(90.0, 0.0, 0.0, 1.0);
@@ -1125,7 +1127,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
/* center circle, do not add to selection when shift is pressed (planar constraint) */
if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C);
- manipulator_setcolor(v3d, 'c', colcode, 255);
+ manipulator_setcolor(v3d, 'C', colcode, 255);
glPushMatrix();
size= screen_aligned(rv3d, rv3d->twmat);
unit_m4(unitmat);
@@ -1158,21 +1160,21 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
glTranslatef(0.0, 0.0, dz);
if(drawflags & MAN_SCALE_Z) {
if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z);
- manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+ manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
drawsolidcube(cusize);
}
/* X cube */
glTranslatef(dz, 0.0, -dz);
if(drawflags & MAN_SCALE_X) {
if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X);
- manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+ manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
drawsolidcube(cusize);
}
/* Y cube */
glTranslatef(-dz, dz, 0.0);
if(drawflags & MAN_SCALE_Y) {
if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y);
- manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+ manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
drawsolidcube(cusize);
}
@@ -1243,7 +1245,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
/* center circle, do not add to selection when shift is pressed (planar constraint) */
if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C);
- manipulator_setcolor(v3d, 'c', colcode, 255);
+ manipulator_setcolor(v3d, 'C', colcode, 255);
glPushMatrix();
size= screen_aligned(rv3d, rv3d->twmat);
unit_m4(unitmat);
@@ -1270,7 +1272,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
glTranslatef(0.0, 0.0, dz);
if(drawflags & MAN_TRANS_Z) {
if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z);
- manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+ manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
draw_cone(qobj, cylen, cywid);
}
/* X Cone */
@@ -1278,7 +1280,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
if(drawflags & MAN_TRANS_X) {
if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+ manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
draw_cone(qobj, cylen, cywid);
glRotatef(-90.0, 0.0, 1.0, 0.0);
}
@@ -1287,7 +1289,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
if(drawflags & MAN_TRANS_Y) {
if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+ manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
draw_cone(qobj, cylen, cywid);
}
@@ -1369,7 +1371,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
glTranslatef(0.0, 0.0, 1.0);
if(drawflags & MAN_ROT_Z) {
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
- manipulator_setcolor(v3d, 'z', colcode, 255);
+ manipulator_setcolor(v3d, 'Z', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
}
/* X cyl */
@@ -1377,7 +1379,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
if(drawflags & MAN_ROT_X) {
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
glRotatef(90.0, 0.0, 1.0, 0.0);
- manipulator_setcolor(v3d, 'x', colcode, 255);
+ manipulator_setcolor(v3d, 'X', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
glRotatef(-90.0, 0.0, 1.0, 0.0);
}
@@ -1386,7 +1388,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
if(drawflags & MAN_ROT_Y) {
if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
glRotatef(-90.0, 1.0, 0.0, 0.0);
- manipulator_setcolor(v3d, 'y', colcode, 255);
+ manipulator_setcolor(v3d, 'Y', colcode, 255);
draw_cylinder(qobj, cylen, cywid);
}