Skip to content

LocalizationFeature should be concrete type? #19

@cserteGT3

Description

@cserteGT3

Current implementation:

abstract type LocalizationFeature{R,M} end

struct HoleLocalizationFeature{R<:AbstractHoleGeometry,M<:AbstractHoleGeometry} <: LocalizationFeature{R,M}
    descriptor::FeatureDescriptor
    rough::R
    machined::M
end

struct PlaneLocalizationFeature{R<:AbstractPlaneGeometry,M<:AbstractPlaneGeometry} <: LocalizationFeature{R,M}
    descriptor::FeatureDescriptor
    rough::R
    machined::M
end

Can I replace it with something like:

struct LocalizationFeature{R,M}
    descriptor::FeatureDescriptor
    rough::R
    machined::M
end

const HoleLocalizationFeature = LocalizationFeature{R,M} where {R<:AbstractHoleGeometry,M<:AbstractHoleGeometry}
const PlaneLocalizationFeature =  LocalizationFeature{R,M} where {R<:AbstractPlaneGeometry,M<:AbstractPlaneGeometry}

R and M must be handled separately, because it is possible, that those are of different types (a mesh hole type and a primitive hole type for example).
Does it change if #3 will be merged?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions