|
Module Simantics/DiagramAffine Transformsdata Position
is a 2D affine transform with a rotation/scale/shear part,
i.e.
Position :: Double -> Double -> Double -> Double -> Double -> Double -> Position location :: Double -> Double -> Position
Returns an affine transform with identity rotation and move :: (Double, Double) -> Position -> Position
Returns a function that adds rotate :: Integer -> Position -> Position
Returns a function that rotates the specified affine transform by scale :: Double -> Position -> Position
Multiplies the rotation part of the specified affine
withScale :: Double -> Position -> Position
Sets the rotation part so that the base vectors defined by
flipX :: Position -> Position
Performs a mirror operation for the specified flipY :: Position -> Position
Performs a mirror operation for the specified positionToDoubleArray :: Position -> Vector Double Converts a Position into a positionToVector :: Position -> Vector Double Converts a Position into a Diagram Browsingdiagram :: Resource -> [String] -> <ReadGraph> Resource Returns a diagram in the given model with the given model relative path. The first Note that this function returns the diagram configuration composite resource. If you need to get the actual diagram resource, use compositeToDiagram on the configuration composite resource. So for example if you have the following hierarchy
the function would be used to fetch the
possibleDiagram :: Resource -> [String] -> <ReadGraph> Maybe Resource Same as diagram but returns Note that this function returns the diagram configuration composite resource. If you need to get the actual diagram resource, use compositeToDiagram on the configuration composite resource. diagramsOf :: Resource -> <ReadGraph> [Resource]
Returns all configuration diagrams of the given model. Note that this function returns the diagram configuration composite resource. If you need to get the actual diagram resource, use compositeToDiagram on the configuration composite resources. diagramsUnder :: Resource -> <ReadGraph> [Resource] Returns all diagrams under the specified diagram folder. The parameter can also be the configuration root Note that this function returns diagram configuration composite resources. If you need to get the actual diagram resources, use map compositeToDiagram on the configuration composite resources. Consider for example if you have the following hierarchy
the function would be used to fetch the
Undocumented entitiesBaseline :: Alignment Center :: Alignment Component :: a -> String -> Position -> [Property a] -> DiagramElement a Connection :: [ConnectionNode a] -> [Edge] -> Maybe String -> DiagramElement a DiagramInfo :: Resource -> Resource -> MMap.T String Resource -> DiagramInfo Edge :: Integer -> Integer -> Edge ExistingDiagram :: Resource -> DiagramSpec Flag :: a -> String -> String -> Boolean -> Boolean -> Maybe String -> Maybe Integer -> Position -> [Dynamic] -> DiagramElement a Font :: String -> Integer -> Integer -> Font Leading :: Alignment Monitor :: String -> Maybe MonitorReference -> MonitorVisuals -> Position -> DiagramElement a MonitorReference :: String -> String -> MonitorReference MonitorVisuals :: Maybe Font -> Double -> Alignment -> Alignment -> MonitorVisuals NewDiagram :: Resource -> [String] -> Resource -> Resource -> DiagramSpec Property :: a -> Dynamic -> Property a RouteLine :: Boolean -> Double -> ConnectionNode a SVG :: String -> Position -> DiagramElement a SimpleConnection :: String -> a -> String -> a -> Maybe String -> DiagramElement a Terminal :: String -> a -> ConnectionNode a Text :: Resource -> String -> TextVisuals -> Position -> DiagramElement a TextVisuals :: Maybe Font -> Alignment -> Alignment -> TextVisuals Trailing :: Alignment alignmentToResource :: Alignment -> Resource applyConnectionType :: Resource -> <Proc,WriteGraph,ReadGraph> () applyDiagramMapping :: Resource -> <Proc,WriteGraph> () claimFolder :: Resource -> [String] -> Resource -> <Proc,WriteGraph> Resource claimModelFolder :: Resource -> [String] -> Resource -> <Proc,WriteGraph> Resource componentToElement :: Resource -> <ReadGraph> Resource compositeToDiagram :: Resource -> <ReadGraph> Resource compositeToDiagram' :: Resource -> <ReadGraph> Resource createComposite :: Resource -> String -> Resource -> <WriteGraph> Resource createComposite_ :: Resource -> String -> Resource -> <WriteGraph> Resource createComposite__ :: Resource -> String -> Resource -> <WriteGraph> Resource createDiagramR :: DiagramSpec -> (Dynamic -> <WriteGraph> Resource) -> [DiagramElement Resource] -> <WriteGraph> (Resource, [Resource]) Creates or modifies an existing diagram to contain the given diagram elements. createJoinMap :: () -> <Proc> Dynamic -> <WriteGraph> Resource createSVGElement :: Resource -> String -> Vector Byte -> Double -> Double -> <WriteGraph> () createSVGElementR :: Resource -> String -> Vector Byte -> Double -> Double -> <WriteGraph> Resource defaultSymbolDropHandler :: [WorkbenchSelectionElement] -> <WriteGraph> () determineConnectionType :: Resource -> <ReadGraph> Maybe Resource Takes one connection element and returns possible diagram type. diagramResourceOf :: Resource -> <ReadGraph> Resource elementToComponent :: Resource -> <ReadGraph> Resource elementsOfR :: Resource -> <ReadGraph> [(DiagramElement Resource, Resource)] Returns the elements of the given diagram. flipConnection :: Resource -> Boolean -> Double -> <WriteGraph> () genericFlagType :: () -> <ReadGraph> Resource Returns the diagram flag type resource used for all generic diagram flags. getConnection :: Resource -> String -> <ReadGraph> [Resource] getConnections :: Resource -> <ReadGraph> [Resource] getOrCreateFolder :: Resource -> Resource -> String -> <Proc,WriteGraph> Resource importSVGElement :: Resource -> File -> Double -> Double -> <WriteGraph> () importSVGElementR :: Resource -> File -> Double -> Double -> <WriteGraph> Resource joinFlagsLocal :: [Resource] -> <WriteGraph> () mapDiagramElement :: (a -> <c> b) -> (a -> <c> b) -> (a -> <c> Maybe b) -> (a -> <c> b) -> DiagramElement a -> <c> DiagramElement b Constructs a transformation for a diagram element. moveConnection :: Resource -> Double -> Double -> <WriteGraph> () newTypicalDiagram :: Resource -> Resource pathNameOf :: Resource -> <ReadGraph> String pathOf :: Resource -> <ReadGraph> [String] Returns a model configuration relative path of the given diagram. removeElement :: Resource -> Resource -> <WriteGraph> () resourceToAlignment :: Browsable a => Show a => a -> <ReadGraph> Alignment rotateConnection :: Resource -> Double -> Double -> Boolean -> <WriteGraph> () rotateDegrees :: Double -> Position -> Position
Returns a function that rotates the specified affine transform by setElements :: DiagramInfo -> (Dynamic -> <WriteGraph> Resource) -> [DiagramElement Resource] -> <Proc,WriteGraph> [Resource] Sets the elements of the diagram. Diagram is assumed to be empty, but the configuration may contain existing components that can be found from the given existing components map. setProfileMonitorsDirectionUp :: Resource -> Boolean -> <WriteGraph> () setStraightConnectionLines :: Resource -> Boolean -> <WriteGraph> () setTransform :: Resource -> Vector Double -> <WriteGraph> () showProfileMonitors :: Resource -> Boolean -> <WriteGraph> () splitConnection :: Resource -> Double -> Double -> <WriteGraph> () syncActivateDiagram :: Resource -> <WriteGraph,Proc> Boolean syncTypicalInstance :: Resource -> <WriteGraph> () transformElement :: (Position -> Position) -> Resource -> <WriteGraph> ()
Performs the affine transformation encapsulated by For examples of possible transformer functions, see scaleTransform and transformWithScale. transformElements :: (Position -> Position) -> [Resource] -> <WriteGraph> ()
Runs transformElement using the specified transformer for
all the specified Use this function together with e.g. scaleTransform and transformWithScale or similar functions. Examples:
translateRouteNodes :: Resource -> Double -> Double -> <WriteGraph> () |