-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ray tracing materials to dispatch output based on material t…
…raits Add AbstractReturnTrait & AbstractPolarizationTrait for materials that change raytracing output
- Loading branch information
1 parent
1da85a9
commit 38aabab
Showing
5 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
$TYPEDEF | ||
Abstract Material | ||
""" | ||
abstract type AbstractMaterial end | ||
|
||
#TODO: replace with trait | ||
isOcclusive(material::AbstractMaterial) = false | ||
#TODO: replace with trait | ||
isAxisymmetric(material::AbstractMaterial) = false | ||
#TODO: replace with trait | ||
isFastLight(material::AbstractMaterial) = false | ||
|
||
yield(material::AbstractMaterial) = 0 | ||
|
||
abstract type AbstractReturnTrait end | ||
abstract type AbstractPolarizationTrait <: AbstractReturnTrait end | ||
struct SimplePolarizationTrait <: AbstractPolarizationTrait end | ||
struct SimpleIntensityTrait <: AbstractReturnTrait end | ||
|
||
function returnTrait(mat::AbstractMaterial) | ||
return SimpleIntensityTrait() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters