Add ignore polygon as point area

This commit is contained in:
Victor Shcherb 2016-12-07 22:17:38 +01:00
parent cd071befc4
commit 977aa6b26a
2 changed files with 9 additions and 2 deletions

View file

@ -199,6 +199,8 @@ public class RenderingRuleSearchRequest {
} else if(isSpecified(storage.PROPS.R_ATTR_INT_VALUE)){
values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_INT_VALUE);
fvalues[rp.getId()] = getFloatPropertyValue(storage.PROPS.R_ATTR_INT_VALUE);
} else if(isSpecified(storage.PROPS.R_ATTR_BOOL_VALUE)){
values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_BOOL_VALUE);
}
} else if (rp.isFloat()) {
fvalues[rp.getId()] = rule.getFloatProp(i);
@ -278,6 +280,11 @@ public class RenderingRuleSearchRequest {
return values[property.getId()];
}
public boolean getBoolPropertyValue(RenderingRuleProperty property) {
int val = values[property.getId()];
return val != -1 && val != 0;
}
public int getIntPropertyValue(RenderingRuleProperty property, int defValue) {
int val = values[property.getId()];
return val == -1 ? defValue : val;

View file

@ -305,8 +305,8 @@ public class RenderingRuleStorageProperties {
R_SHADOW_RADIUS = registerRuleInternal(RenderingRuleProperty.createOutputFloatProperty(SHADOW_RADIUS));
R_ONEWAY_ARROWS_COLOR = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(ONEWAY_ARROWS_COLOR));
R_ADD_POINT = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(ADD_POINT));
R_IGNORE_POLYGON_AS_POINT_AREA = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(IGNORE_POLYGON_AS_POINT_AREA));
R_ADD_POINT = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(ADD_POINT));
R_IGNORE_POLYGON_AS_POINT_AREA = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(IGNORE_POLYGON_AS_POINT_AREA));
}
public RenderingRuleProperty get(String name) {