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.pull/4/head
parent
614902ebdd
commit
73f28b9731
19
src/draw.cpp
19
src/draw.cpp
|
@ -19,15 +19,6 @@ bool GraphicsWindow::Selection::IsEmpty(void) {
|
|||
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) {
|
||||
if(!entity.v) return false;
|
||||
Entity *e = SK.GetEntity(entity);
|
||||
|
@ -257,12 +248,14 @@ void GraphicsWindow::GroupSelection(void) {
|
|||
(gs.n)++;
|
||||
|
||||
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.
|
||||
if(e->IsPoint()) {
|
||||
gs.point[(gs.points)++] = s->entity;
|
||||
} else {
|
||||
gs.entity[(gs.entities)++] = s->entity;
|
||||
(gs.stylables)++;
|
||||
}
|
||||
|
||||
// And an auxiliary list of normals, including normals from
|
||||
|
@ -305,10 +298,8 @@ void GraphicsWindow::GroupSelection(void) {
|
|||
if(s->constraint.v) {
|
||||
gs.constraint[(gs.constraints)++] = s->constraint;
|
||||
Constraint *c = SK.GetConstraint(s->constraint);
|
||||
if(c->type == Constraint::COMMENT) {
|
||||
(gs.stylables)++;
|
||||
(gs.comments)++;
|
||||
}
|
||||
if(c->IsStylable()) gs.stylables++;
|
||||
if(c->type == Constraint::COMMENT) gs.comments++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1117,3 +1117,8 @@ void Constraint::GetEdges(SEdgeList *sel) {
|
|||
dogd.sel = NULL;
|
||||
}
|
||||
|
||||
bool Constraint::IsStylable() {
|
||||
if(type == COMMENT) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -205,6 +205,13 @@ Vector Entity::GetReferencePos(void) {
|
|||
return dogd.refp;
|
||||
}
|
||||
|
||||
bool Entity::IsStylable() {
|
||||
if(IsPoint()) return false;
|
||||
if(IsWorkplane()) return false;
|
||||
if(IsNormal()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Entity::IsVisible(void) {
|
||||
Group *g = SK.GetGroup(group);
|
||||
|
||||
|
|
|
@ -494,6 +494,7 @@ public:
|
|||
void LineDrawOrGetDistance(Vector a, Vector b, bool maybeFat=false);
|
||||
void DrawOrGetDistance(void);
|
||||
|
||||
bool IsStylable();
|
||||
bool IsVisible(void);
|
||||
bool PointIsFromReferences(void);
|
||||
|
||||
|
@ -676,6 +677,7 @@ public:
|
|||
Vector GetReferencePos(void);
|
||||
void Draw(void);
|
||||
void GetEdges(SEdgeList *sel);
|
||||
bool IsStylable();
|
||||
|
||||
void LineDrawOrGetDistance(Vector a, Vector b);
|
||||
void DrawOrGetDistance(Vector *labelPos);
|
||||
|
|
|
@ -148,6 +148,9 @@ void Style::AssignSelectionToStyle(uint32_t v) {
|
|||
int i;
|
||||
for(i = 0; i < SS.GW.gs.entities; i++) {
|
||||
hEntity he = SS.GW.gs.entity[i];
|
||||
Entity *e = SK.GetEntity(he);
|
||||
if(!e->IsStylable()) continue;
|
||||
|
||||
if(!he.isFromRequest()) {
|
||||
showError = true;
|
||||
continue;
|
||||
|
@ -161,7 +164,7 @@ void Style::AssignSelectionToStyle(uint32_t v) {
|
|||
for(i = 0; i < SS.GW.gs.constraints; i++) {
|
||||
hConstraint hc = SS.GW.gs.constraint[i];
|
||||
Constraint *c = SK.GetConstraint(hc);
|
||||
if(c->type != Constraint::COMMENT) continue;
|
||||
if(!c->IsStylable()) continue;
|
||||
|
||||
c->disp.style.v = v;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue