-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Mod bufferobject #2981
Mod bufferobject #2981
Conversation
Hi, thanks for the contribution! Your changes define interfaces using the default values rather than the actual types. I would recommend looking at the code for |
I have made a series of enhancements to vtkOpenGLTexture and vtkOpenGLBufferObject to improve its type safety and readability. Here is an overview of the key changes: Consistency and Clarity in Type Definitions: Following the precedent set by previous Pull Requests, such as #2976 , I ensured that my type definitions are consistent with the existing code in the project. I introduced new types to more clearly represent some complex structures and concepts. Enhanced Documentation and Comments: I have added detailed comments and documentation, explaining the new types and the modified sections. This will help other developers understand the purpose of these changes and how to use them. I believe these changes will enhance the robustness and maintainability of vtkOpenGLTexture and vtkOpenGLBufferObject and look forward to everyone's feedback. Thank you for your time and consideration. |
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.
Thanks for the update! I think it should be good to go after some changes.
There are some whitespace quirks that would be nice to adjust, but I'll just have prettier enforce formatting on d.ts
files in a future PR.
@@ -54,7 +54,7 @@ export interface vtkSelectionNode extends vtkObject { | |||
/** | |||
* This functions is called internally by VTK.js and is not intended for public use. | |||
*/ | |||
setProperties(properties: ISelectionNodeProperties); | |||
setProperties(properties: ISelectionNodeProperties):any; |
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.
setProperties(properties: ISelectionNodeProperties):any; | |
setProperties(properties: ISelectionNodeProperties): boolean; |
This is an auto-generated setter, so it returns boolean. (Returns true if the underlying value is actually changed).
@@ -64,7 +64,7 @@ export interface vtkSelectionNode extends vtkObject { | |||
/** | |||
* This functions is called internally by VTK.js and is not intended for public use. | |||
*/ | |||
setSelectionList(selectionAttributeIDs: ISelectionNodeProperties); | |||
setSelectionList(selectionAttributeIDs: ISelectionNodeProperties):any; |
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.
Same thing here: should be boolean
objectType: ObjectType; | ||
context?: WebGLRenderingContext | WebGL2RenderingContext; | ||
allocatedGPUMemoryInBytes: number; |
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.
objectType
and allocatedGPUMemoryInBytes
should be optional, since generally initial values are optional.
type vtkOpenGLBufferObjectBase = Omit<vtkObject, 'set'> & vtkAlgorithm; | ||
|
||
/** | ||
* Interface for OpenGL Buffer Object | ||
*/ | ||
export interface vtkOpenGLBufferObject extends vtkOpenGLBufferObjectBase { |
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.
It looks to me that vtkOpenGLBufferObject
merely extends vtkObject
instead of what you have defined here.
/** | ||
* Interface for OpenGL Texture. | ||
*/ | ||
export interface vtkOpenGLTexture extends vtkOpenGLTextureBase { |
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.
This should be vtkOpenGLTexture extends vtkViewNode
, based on what vtkOpenGLTexture extends in the codebase.
* Renders the texture within the given render window. | ||
* @param renWin The render window in which to render the texture. | ||
*/ | ||
render(renWin:any):void; |
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.
render(renWin:any):void; | |
render(renWin: vtkOpenGLRenderWindow):void; |
* Releases the graphics resources used by the texture within the given render window. | ||
* @param renWin The render window whose resources should be released. | ||
*/ | ||
releaseGraphicsResources(renWin:any):void; |
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.
releaseGraphicsResources(renWin:any):void; | |
releaseGraphicsResources(renWin: vtkOpenGLRenderWindow):void; |
* Sets the OpenGL render window in which the texture will be used. | ||
* @param renWin The render window to set. | ||
*/ | ||
setOpenGLRenderWindow(renWin:any):void; |
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.
setOpenGLRenderWindow(renWin:any):void; | |
setOpenGLRenderWindow(renWin: vtkOpenGLRenderWindow):void; |
Thank you for your feedback. I have made the necessary corrections as per your suggestions and also adjusted the spacing issues. |
This is good to go after my most recent comment. |
🎉 This PR is included in version 29.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
fix bug
TS7016: Could not find a declaration file for module BufferObject and Texture
Results
No Errors
Changes
PR and Code Checklist
npm run reformat
to have correctly formatted codeTesting