Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Stylize points mesh. #2180

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Feature: Stylize points mesh. #2180

merged 2 commits into from
Oct 30, 2023

Conversation

gchoqueux
Copy link
Contributor

@gchoqueux gchoqueux commented Sep 1, 2023

Description

Refactoring Feature and Feature2Mesh to improve software architecture
and add styling points feature.

Software architecture

  • Move Style responsibility from Feature to Feature2Mesh, because no stylisation must be applied when parsing.
  • Add FeatureContext class to encapsulate all properties and methods necessary for stylization.

Motivation and Context

  • Start delete Style from Feature
  • Move Style in convert give points stylization feature
  • Remove altitude.min and max because they were added purely for aesthetic reasons

Screenshots

image

@gchoqueux gchoqueux added this to the 2.41.0 milestone Sep 1, 2023
@gchoqueux gchoqueux marked this pull request as draft September 1, 2023 14:07
@gchoqueux gchoqueux force-pushed the clean_alti branch 4 times, most recently from cc81cb6 to 3a3947f Compare September 1, 2023 16:52
@gchoqueux gchoqueux marked this pull request as ready for review September 1, 2023 17:05
@gchoqueux gchoqueux force-pushed the clean_alti branch 3 times, most recently from e8ba758 to c27b318 Compare September 5, 2023 13:00
Copy link
Contributor

@ftoromanoff ftoromanoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you changed the context from:
const context = { globals, properties: () => geometry.properties };
to

context.setCollection(options.collection);
...
context.globals = { point: true }
...
context.setGeometry(geometry);

It should also be done in file Feature2Texture and LabelLayer that also use 'context'.

src/Converter/Feature2Mesh.js Show resolved Hide resolved
@@ -650,6 +669,8 @@ export default {
options.layer = this;
}

options.collection = collection;
Copy link
Contributor

@ftoromanoff ftoromanoff Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use context.setCollection(options.collection) here instead of each sub functions ?
and use options.matrixWorldInverse and options.crs or context.get matrixWordInverse and crs

Copy link
Contributor Author

@gchoqueux gchoqueux Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks, good catch
I pushed a proposal

@gchoqueux
Copy link
Contributor Author

It should also be done in file Feature2Texture and LabelLayer that also use 'context'.

yes in other PR, because there's many changes in this current PR

@gchoqueux
Copy link
Contributor Author

@ftoromanoff with your comment on new THREE.Group in FeatureMesh class,
I've noticed that it's actually unnecessarily complex
I push a new proposal but I'm not sure if it covers all cases of use, in particular when base_altitude is undefined

@gchoqueux gchoqueux force-pushed the clean_alti branch 2 times, most recently from 2c35395 to 4b3337e Compare October 10, 2023 08:48
@ftoromanoff ftoromanoff requested a review from jailln October 10, 2023 15:49
examples/source_stream_wfs_25d.html Outdated Show resolved Hide resolved
examples/source_stream_wfs_25d.html Outdated Show resolved Hide resolved
examples/source_stream_wfs_25d.html Show resolved Hide resolved
src/Converter/Feature2Mesh.js Outdated Show resolved Hide resolved
src/Converter/Feature2Mesh.js Show resolved Hide resolved
src/Converter/Feature2Mesh.js Show resolved Hide resolved
src/Converter/Feature2Mesh.js Show resolved Hide resolved
src/Converter/Feature2Mesh.js Show resolved Hide resolved
src/Converter/Feature2Mesh.js Outdated Show resolved Hide resolved
src/Core/Style.js Outdated Show resolved Hide resolved
Refactoring Feature and Feature2Mesh to improve software architecture
and add styling points feature.

Software architecture
 * move Style responsibility from Feature to Feature2Mesh,
   because no stylisation must be applied when parsing.
 * add FeatureContext class to encapsulate all properties
   and methods necessary for stylization.
@jailln jailln merged commit b7538b0 into iTowns:master Oct 30, 2023
7 checks passed
@gchoqueux gchoqueux deleted the clean_alti branch January 22, 2024 14:30
@gchoqueux
Copy link
Contributor Author

the example source_stream_wfs_25d.html is broken ?
there isn't styling by distance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants