+ fix indentation, untabify and strip trailing spaces

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5054 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
logari81 2011-10-22 11:57:49 +00:00
parent d6a0e3cf14
commit 3d9c7771f8
2 changed files with 26 additions and 29 deletions

View File

@ -178,7 +178,7 @@ void SoDatumLabel::generatePrimitives(SoAction * action)
float width, height;
if(action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
if (action->getTypeId() == SoGLRenderAction::getClassTypeId()) {
// Update using the GL state
SoState *state = action->getState();
float srcw = size[0];
@ -227,7 +227,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
SoState *state = action->getState();
if (!shouldGLRender(action))
return;
if(action->handleTransparency(true))
if (action->handleTransparency(true))
return;
drawImage();
@ -243,7 +243,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
glPixelStorei(GL_UNPACK_ROW_LENGTH, srcw);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT);
glDisable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
@ -255,14 +255,14 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
glGenTextures(1, &myTexture);
glBindTexture(GL_TEXTURE_2D, myTexture);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, nc, srcw, srch, 0, GL_RGBA, GL_UNSIGNED_BYTE,(const GLvoid*) dataptr);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Create the quad to hold texture
// Create the quad to hold texture
const SbViewVolume & vv = SoViewVolumeElement::get(state);
float scale = vv.getWorldToScreenScale(SbVec3f(0.f,0.f,0.f), 0.4f);
@ -271,21 +271,18 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action)
float width = aspectRatio * (float) height;
this->bbx = width;
this->bby = height;
this->bby = height;
glBegin(GL_QUADS);
glColor3f(1.f, 1.f, 1.f);
glTexCoord2f(0.f, 1.f); glVertex2f(-width/ 2, height / 2);
glTexCoord2f(0.f, 0.f); glVertex2f(-width / 2,-height / 2);
glTexCoord2f(1.f, 0.f); glVertex2f( width/ 2,-height / 2);
glTexCoord2f(1.f, 1.f); glVertex2f( width / 2, height / 2);
glEnd();
// Reset the Mode
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
glPopAttrib();
state->pop();
}

View File

@ -732,7 +732,7 @@ bool ViewProviderSketch::mouseMove(const SbVec3f &point, const SbVec3f &normal,
if (preselectChanged) {
this->drawConstraintIcons();
this->updateColor();
return true;
return true;
}
return false;
case STATUS_SELECT_Point:
@ -1324,33 +1324,33 @@ void ViewProviderSketch::updateColor(void)
for (int i=0; i < edit->constrGroup->getNumChildren(); i++) {
SoSeparator *s = dynamic_cast<SoSeparator *>(edit->constrGroup->getChild(i));
SoMaterial *m = dynamic_cast<SoMaterial *>(s->getChild(0));
// Check Constraint Type
ConstraintType type = this->getSketchObject()->Constraints.getValues()[i]->Type;
bool hasDatumLabel = (type == Sketcher::Angle ||
type == Sketcher::Radius ||
type == Sketcher::Distance || type == Sketcher::DistanceX || type == Sketcher::DistanceY);
if (edit->SelConstraintSet.find(i) != edit->SelConstraintSet.end()) {
m->diffuseColor = SelectColor;
if(hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = SelectColor;
}
m->diffuseColor = SelectColor;
if (hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = SelectColor;
}
} else if (edit->PreselectConstraint == i) {
m->diffuseColor = PreselectColor;
if(hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = PreselectColor;
}
m->diffuseColor = PreselectColor;
if (hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = PreselectColor;
}
}
else {
m->diffuseColor = ConstraintColor;
if(hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = ConstraintColor;
}
}
m->diffuseColor = ConstraintColor;
if (hasDatumLabel) {
SoDatumLabel *l = dynamic_cast<SoDatumLabel *>(s->getChild(4));
l->textColor = ConstraintColor;
}
}
}
// end editing