Make normals and workplanes non-stylable.
This does not seem to have any useful application, and it can result in odd misrenderings with some styles.
This commit is contained in:
parent
614902ebdd
commit
73f28b9731
19
src/draw.cpp
19
src/draw.cpp
|
@ -19,15 +19,6 @@ bool GraphicsWindow::Selection::IsEmpty(void) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GraphicsWindow::Selection::IsStylable(void) {
|
|
||||||
if(entity.v) return true;
|
|
||||||
if(constraint.v) {
|
|
||||||
Constraint *c = SK.GetConstraint(constraint);
|
|
||||||
if(c->type == Constraint::COMMENT) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GraphicsWindow::Selection::HasEndpoints(void) {
|
bool GraphicsWindow::Selection::HasEndpoints(void) {
|
||||||
if(!entity.v) return false;
|
if(!entity.v) return false;
|
||||||
Entity *e = SK.GetEntity(entity);
|
Entity *e = SK.GetEntity(entity);
|
||||||
|
@ -257,12 +248,14 @@ void GraphicsWindow::GroupSelection(void) {
|
||||||
(gs.n)++;
|
(gs.n)++;
|
||||||
|
|
||||||
Entity *e = SK.entity.FindById(s->entity);
|
Entity *e = SK.entity.FindById(s->entity);
|
||||||
|
|
||||||
|
if(e->IsStylable()) gs.stylables++;
|
||||||
|
|
||||||
// A list of points, and a list of all entities that aren't points.
|
// A list of points, and a list of all entities that aren't points.
|
||||||
if(e->IsPoint()) {
|
if(e->IsPoint()) {
|
||||||
gs.point[(gs.points)++] = s->entity;
|
gs.point[(gs.points)++] = s->entity;
|
||||||
} else {
|
} else {
|
||||||
gs.entity[(gs.entities)++] = s->entity;
|
gs.entity[(gs.entities)++] = s->entity;
|
||||||
(gs.stylables)++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// And an auxiliary list of normals, including normals from
|
// And an auxiliary list of normals, including normals from
|
||||||
|
@ -305,10 +298,8 @@ void GraphicsWindow::GroupSelection(void) {
|
||||||
if(s->constraint.v) {
|
if(s->constraint.v) {
|
||||||
gs.constraint[(gs.constraints)++] = s->constraint;
|
gs.constraint[(gs.constraints)++] = s->constraint;
|
||||||
Constraint *c = SK.GetConstraint(s->constraint);
|
Constraint *c = SK.GetConstraint(s->constraint);
|
||||||
if(c->type == Constraint::COMMENT) {
|
if(c->IsStylable()) gs.stylables++;
|
||||||
(gs.stylables)++;
|
if(c->type == Constraint::COMMENT) gs.comments++;
|
||||||
(gs.comments)++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1117,3 +1117,8 @@ void Constraint::GetEdges(SEdgeList *sel) {
|
||||||
dogd.sel = NULL;
|
dogd.sel = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Constraint::IsStylable() {
|
||||||
|
if(type == COMMENT) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,6 +205,13 @@ Vector Entity::GetReferencePos(void) {
|
||||||
return dogd.refp;
|
return dogd.refp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Entity::IsStylable() {
|
||||||
|
if(IsPoint()) return false;
|
||||||
|
if(IsWorkplane()) return false;
|
||||||
|
if(IsNormal()) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Entity::IsVisible(void) {
|
bool Entity::IsVisible(void) {
|
||||||
Group *g = SK.GetGroup(group);
|
Group *g = SK.GetGroup(group);
|
||||||
|
|
||||||
|
|
|
@ -494,6 +494,7 @@ public:
|
||||||
void LineDrawOrGetDistance(Vector a, Vector b, bool maybeFat=false);
|
void LineDrawOrGetDistance(Vector a, Vector b, bool maybeFat=false);
|
||||||
void DrawOrGetDistance(void);
|
void DrawOrGetDistance(void);
|
||||||
|
|
||||||
|
bool IsStylable();
|
||||||
bool IsVisible(void);
|
bool IsVisible(void);
|
||||||
bool PointIsFromReferences(void);
|
bool PointIsFromReferences(void);
|
||||||
|
|
||||||
|
@ -676,6 +677,7 @@ public:
|
||||||
Vector GetReferencePos(void);
|
Vector GetReferencePos(void);
|
||||||
void Draw(void);
|
void Draw(void);
|
||||||
void GetEdges(SEdgeList *sel);
|
void GetEdges(SEdgeList *sel);
|
||||||
|
bool IsStylable();
|
||||||
|
|
||||||
void LineDrawOrGetDistance(Vector a, Vector b);
|
void LineDrawOrGetDistance(Vector a, Vector b);
|
||||||
void DrawOrGetDistance(Vector *labelPos);
|
void DrawOrGetDistance(Vector *labelPos);
|
||||||
|
|
|
@ -148,6 +148,9 @@ void Style::AssignSelectionToStyle(uint32_t v) {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < SS.GW.gs.entities; i++) {
|
for(i = 0; i < SS.GW.gs.entities; i++) {
|
||||||
hEntity he = SS.GW.gs.entity[i];
|
hEntity he = SS.GW.gs.entity[i];
|
||||||
|
Entity *e = SK.GetEntity(he);
|
||||||
|
if(!e->IsStylable()) continue;
|
||||||
|
|
||||||
if(!he.isFromRequest()) {
|
if(!he.isFromRequest()) {
|
||||||
showError = true;
|
showError = true;
|
||||||
continue;
|
continue;
|
||||||
|
@ -161,7 +164,7 @@ void Style::AssignSelectionToStyle(uint32_t v) {
|
||||||
for(i = 0; i < SS.GW.gs.constraints; i++) {
|
for(i = 0; i < SS.GW.gs.constraints; i++) {
|
||||||
hConstraint hc = SS.GW.gs.constraint[i];
|
hConstraint hc = SS.GW.gs.constraint[i];
|
||||||
Constraint *c = SK.GetConstraint(hc);
|
Constraint *c = SK.GetConstraint(hc);
|
||||||
if(c->type != Constraint::COMMENT) continue;
|
if(!c->IsStylable()) continue;
|
||||||
|
|
||||||
c->disp.style.v = v;
|
c->disp.style.v = v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user