| 75 | } |
| 76 | |
| 77 | void FeatureObject::deserializeFields_( const Json::Value& root ) |
| 78 | { |
| 79 | VisualObject::deserializeFields_( root ); |
| 80 | |
| 81 | if ( const auto& subfeatureVisibilityJson = root["SubfeatureVisibility"]; subfeatureVisibilityJson.isUInt() ) |
| 82 | subfeatureVisibility_ = ViewportMask( subfeatureVisibilityJson.asUInt() ); |
| 83 | |
| 84 | if ( const auto& detailsOnNameTagJson = root["DetailsOnNameTag"]; detailsOnNameTagJson.isUInt() ) |
| 85 | detailsOnNameTag_ = ViewportMask( detailsOnNameTagJson.asUInt() ); |
| 86 | |
| 87 | Vector4f color; |
| 88 | deserializeFromJson( root["DecorationsColorUnselected"], color ); decorationsColor_[0] = Color( color ); |
| 89 | deserializeFromJson( root["DecorationsColorSelected"], color ); decorationsColor_[1] = Color( color ); |
| 90 | |
| 91 | if ( const auto& json = root["PointSize"]; json.isDouble() ) |
| 92 | pointSize_ = json.asFloat(); |
| 93 | if ( const auto& json = root["LineWidth"]; json.isDouble() ) |
| 94 | lineWidth_ = json.asFloat(); |
| 95 | if ( const auto& json = root["SubPointSize"]; json.isDouble() ) |
| 96 | subPointSize_ = json.asFloat(); |
| 97 | if ( const auto& json = root["SubLineWidth"]; json.isDouble() ) |
| 98 | subLineWidth_ = json.asFloat(); |
| 99 | |
| 100 | if ( const auto& json = root["MainAlpha"]; json.isDouble() ) |
| 101 | mainFeatureAlpha_ = json.asFloat(); |
| 102 | if ( const auto& json = root["SubAlphaPoints"]; json.isDouble() ) |
| 103 | subAlphaPoints_ = json.asFloat(); |
| 104 | if ( const auto& json = root["SubAlphaLines"]; json.isDouble() ) |
| 105 | subAlphaLines_ = json.asFloat(); |
| 106 | if ( const auto& json = root["SubAlphaMesh"]; json.isDouble() ) |
| 107 | subAlphaMesh_ = json.asFloat(); |
| 108 | |
| 109 | for ( std::size_t i = 0; i < std::size_t( DimensionsVisualizePropertyType::_count ); i++ ) |
| 110 | { |
| 111 | const auto enumValue = DimensionsVisualizePropertyType( i ); |
| 112 | if ( supportsVisualizeProperty( enumValue ) ) |
| 113 | if ( const auto& json = root["DimensionVisibility"][toString( enumValue ).data()]; json.isUInt() ) |
| 114 | setVisualizePropertyMask( enumValue, ViewportMask( json.asUInt() ) ); |
| 115 | } |
| 116 | |
| 117 | // only default xf value serialize now. |
| 118 | decomposeMatrix3( xf().A, r_.get(), s_.get() ); |
| 119 | } |
| 120 | |
| 121 | std::optional<Vector3f> FeatureObject::getNormal( const Vector3f& point ) const |
| 122 | { |
nothing calls this directly
no test coverage detected