-
Notifications
You must be signed in to change notification settings - Fork 114
Universal CAD artists #904
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
Changes from all commits
df11766
aeeac41
e8e4515
2ac21c2
e4dc099
97be6e7
59c8cc3
042ebb9
d1f8e36
1143b68
1b04504
25dcfb8
618f3f6
b8c6886
2c435ed
33c780c
b64891e
1b34a18
4bc62cf
76fd2ac
03575b4
5f6f540
4618a50
5673b21
66e8866
9ec87ca
46af2e2
11d296a
28a5bde
ea2d083
78f6e96
339fc48
5c49723
e528daa
d67c806
45b013f
5ee4af5
8144543
c81a9e6
ae60fae
9157edf
db3735c
2d735e9
479e509
89c7f87
58671de
48ba793
bde413f
f14e4f4
29134a3
3bb98a4
dfbd4d6
386b017
3a17361
2609c18
56b6737
3e010b2
5edf1ce
cd2eafd
34a73b7
b3c80d9
9d4be79
18e8914
359887a
1d476c4
ce4a93f
b0588db
1dcdc10
fe9e997
b5061d8
dffc7b7
5cbb2b8
7a16821
50cbead
bda3497
072f200
d4ac48f
a74776f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
|
|
||
| .. automodule:: compas.artists |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| :maxdepth: 1 | ||
| :titlesonly: | ||
|
|
||
| compas.artists | ||
| compas.data | ||
| compas.datastructures | ||
| compas.files | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| """ | ||
| ******************************************************************************** | ||
| artists | ||
| ******************************************************************************** | ||
|
|
||
| .. currentmodule:: compas.artists | ||
|
|
||
| Classes | ||
| ======= | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| Artist | ||
| RobotModelArtist | ||
| MeshArtist | ||
| NetworkArtist | ||
| PrimitiveArtist | ||
| ShapeArtist | ||
| VolMeshArtist | ||
|
|
||
|
|
||
| Exceptions | ||
| ========== | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| DataArtistNotRegistered | ||
|
|
||
| """ | ||
| from __future__ import print_function | ||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
|
|
||
| from .exceptions import DataArtistNotRegistered | ||
| from .artist import Artist | ||
| from .meshartist import MeshArtist | ||
| from .networkartist import NetworkArtist | ||
| from .primitiveartist import PrimitiveArtist | ||
| from .robotmodelartist import RobotModelArtist | ||
| from .shapeartist import ShapeArtist | ||
| from .volmeshartist import VolMeshArtist | ||
|
|
||
| BaseRobotModelArtist = RobotModelArtist | ||
|
|
||
| __all__ = [ | ||
| 'DataArtistNotRegistered', | ||
| 'Artist', | ||
| 'MeshArtist', | ||
| 'NetworkArtist', | ||
| 'PrimitiveArtist', | ||
| 'RobotModelArtist', | ||
| 'ShapeArtist', | ||
| 'VolMeshArtist', | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
| from __future__ import print_function | ||
|
|
||
| from abc import abstractmethod | ||
| from compas.plugins import pluggable | ||
|
|
||
|
|
||
| @pluggable(category='drawing-utils') | ||
| def clear(): | ||
| raise NotImplementedError | ||
|
|
||
|
|
||
| @pluggable(category='drawing-utils') | ||
| def redraw(): | ||
| raise NotImplementedError | ||
|
|
||
|
|
||
| @pluggable(category='factories') | ||
| def new_artist(cls, *args, **kwargs): | ||
| raise NotImplementedError | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as in #888: maybe these things should not throw |
||
|
|
||
|
|
||
| class Artist(object): | ||
| """Base class for all artists. | ||
| """ | ||
|
|
||
| ITEM_ARTIST = {} | ||
|
|
||
| def __new__(cls, *args, **kwargs): | ||
| return new_artist(cls, *args, **kwargs) | ||
|
|
||
| @staticmethod | ||
| def clear(): | ||
| return clear() | ||
|
|
||
| @staticmethod | ||
| def redraw(): | ||
| return redraw() | ||
|
|
||
| @staticmethod | ||
| def register(item_type, artist_type): | ||
| Artist.ITEM_ARTIST[item_type] = artist_type | ||
|
|
||
| @abstractmethod | ||
| def draw(self): | ||
| raise NotImplementedError | ||
|
|
||
| @staticmethod | ||
| def draw_collection(collection): | ||
| raise NotImplementedError | ||
|
Comment on lines
+49
to
+51
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused why this is on the base
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha perhaps the name is confusing. was mean to be a static method to draw many objects at the same time. is not related to the "collection" of blender. but since there is no implementation for it anywhere, perhaps it can just be removed... |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| from __future__ import print_function | ||
| from __future__ import absolute_import | ||
| from __future__ import division | ||
| from __future__ import print_function | ||
|
|
||
| from ._artist import * # noqa: F401 F403 | ||
|
|
||
| __all__ = [name for name in dir() if not name.startswith('_')] | ||
| class DataArtistNotRegistered(Exception): | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add an internal deprecation note. Not sure if this specific suggestion is the way, but we should come up with a way to tag all these things that we intend to get rid of before 2.0 so that we can do a search-all-files at the right time.