Allow for assigning attach items orientations
This commit is contained in:
@@ -41,8 +41,9 @@ data ItemStructuralFunction
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
type PartiallyComposedItem lt = (Item, ItemStructuralFunction, LinkTest lt)
|
||||
type ComposedItem = (Item, ItemStructuralFunction)
|
||||
|
||||
data ItemAttachment = IAttach
|
||||
data ItemLink = ILink
|
||||
{ _iatType :: ComposeLinkType
|
||||
, _iatOrient :: Item -> Item -> Maybe (Point3, Quaternion Float)
|
||||
}
|
||||
@@ -58,6 +59,7 @@ data LinkUpdate lt = LUpdate
|
||||
, _luChildUpdate :: PartiallyComposedItem lt -> PartiallyComposedItem lt
|
||||
}
|
||||
|
||||
makeLenses ''ItemLink
|
||||
makeLenses ''LinkTest
|
||||
makeLenses ''LinkUpdate
|
||||
deriveJSON defaultOptions ''ComposeLinkType
|
||||
|
||||
@@ -49,6 +49,11 @@ instance Foldable DoubleTree where
|
||||
instance Functor (LabelDoubleTree b) where
|
||||
fmap f (LDT x l r) = LDT (f x) (fmap (second $ fmap f) l) (fmap (second $ fmap f) r)
|
||||
|
||||
instance Bifunctor LabelDoubleTree where
|
||||
second = fmap
|
||||
first f (LDT x l r) = LDT x (map (first f . second (first f)) l)
|
||||
(map (first f . second (first f)) r)
|
||||
|
||||
makeLenses ''DoubleTree
|
||||
makeLenses ''LabelDoubleTree
|
||||
deriveJSON defaultOptions ''DoubleTree
|
||||
|
||||
Reference in New Issue
Block a user