Added a const (and reformatted)

This commit is contained in:
Paolo Cignoni 2007-05-29 10:09:29 +00:00
parent 35d53d62c3
commit dc881612b1
1 changed files with 30 additions and 58 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.4 2007/05/21 13:22:40 cignoni
Corrected gcc compiling issues
Revision 1.3 2006/02/16 15:16:51 corsini Revision 1.3 2006/02/16 15:16:51 corsini
Add reference plane support Add reference plane support
@ -59,30 +62,16 @@ public:
//! Stroke colors. //! Stroke colors.
enum StrokeColor enum StrokeColor
{ {
BLACK, BLACK, SILVER, GRAY, WHITE,
SILVER, MAROON, RED, PURPLE, FUCHSIA,
GRAY, GREEN, LIME, OLIVE, YELLOW,
WHITE, NAVY, BLUE, TEAL, AQUA
MAROON,
RED,
PURPLE,
FUCHSIA,
GREEN,
LIME,
OLIVE,
YELLOW,
NAVY,
BLUE,
TEAL,
AQUA
}; };
//! Stroke linecap types. //! Stroke linecap types.
enum StrokeLineCap enum StrokeLineCap
{ {
BUTT, BUTT, ROUND, SQUARE
ROUND,
SQUARE
}; };
static const int DEFAULT_LINE_WIDTH; static const int DEFAULT_LINE_WIDTH;
@ -131,52 +120,35 @@ public:
//! Set the stroke color. //! Set the stroke color.
void setColor(enum StrokeColor color) void setColor(enum StrokeColor color)
{ {
if (color == BLACK) switch (color)
stroke_color = "black"; {
else if (color == SILVER) case BLACK : stroke_color = "black"; break;
stroke_color = "silver"; case SILVER : stroke_color = "silver"; break;
else if (color == GRAY) case GRAY : stroke_color = "gray"; break;
stroke_color = "gray"; case WHITE : stroke_color = "white"; break;
else if (color == WHITE) case MAROON : stroke_color = "maroon"; break;
stroke_color = "white"; case RED : stroke_color = "red"; break;
else if (color == MAROON) case PURPLE : stroke_color = "purple"; break;
stroke_color = "maroon"; case FUCHSIA: stroke_color = "fuchsia"; break;
else if (color == RED) case GREEN : stroke_color = "green"; break;
stroke_color = "red"; case OLIVE : stroke_color = "olive"; break;
else if (color == PURPLE) case LIME : stroke_color = "lime"; break;
stroke_color = "purple"; case NAVY : stroke_color = "navy"; break;
else if (color == FUCHSIA) case TEAL : stroke_color = "teal"; break;
stroke_color = "fuchsia"; case AQUA : stroke_color = "aqua"; break;
else if (color == GREEN) default: assert(0);
stroke_color = "green"; }
else if (color == OLIVE)
stroke_color = "olive";
else if (color == LIME)
stroke_color = "lime";
else if (color == YELLOW)
stroke_color = "yellow";
else if (color == NAVY)
stroke_color = "navy";
else if (color == BLUE)
stroke_color = "blue";
else if (color == TEAL)
stroke_color = "teal";
else if (color == AQUA)
stroke_color = "aqua";
} }
//! Set the line cap style. //! Set the line cap style.
void setLineCap(enum StrokeLineCap linecap) void setLineCap(enum StrokeLineCap linecap)
{ {
if (linecap == BUTT) if (linecap == BUTT) stroke_linecap = "butt";
stroke_linecap = "butt"; else if (linecap == ROUND) stroke_linecap = "round";
else if (linecap == ROUND) else if (linecap == SQUARE) stroke_linecap = "square";
stroke_linecap = "round";
else if (linecap == SQUARE)
stroke_linecap = "square";
} }
void setPlane(double distance, Point3d &direction) void setPlane(double distance, const Point3d &direction)
{ {
proj.SetDirection(direction); proj.SetDirection(direction);
proj.SetOffset(distance); proj.SetOffset(distance);