--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+ <name>3d_ontologies</name>\r
+ <comment></comment>\r
+ <projects>\r
+ </projects>\r
+ <buildSpec>\r
+ </buildSpec>\r
+ <natures>\r
+ </natures>\r
+</projectDescription>\r
--- /dev/null
+%import "foundation.graph"\r
+\r
+%import "csg.graph"\r
+%import "equation.graph"\r
--- /dev/null
+%import "layer0.graph"\r
+%import "layer0.graph" L0\r
+%import "animation.graph"\r
+%import "g3d.graph"\r
+%define symmetric()\r
+ $subject\r
+ $layer0.InverseOf $subject\r
+%define tag($tagname)\r
+ $subject\r
+ $tagname $subject\r
+%deflib Type _ @ "Types" : TypeLibrary\r
+ PartOf CSGOntology\r
+%deflib Relation _ @ "Relations" : RelationLibrary\r
+ PartOf CSGOntology\r
+%deflib Library CSGOntology\r
+CSGOntology @ "CSG Ontology" : Ontology\r
+ PartOf TypeSystemProject\r
+ HasNamespace "http://www.vtt.fi/Simantics/CSG/1.0" : URI\r
+ HasVersion "1.0" : Version\r
+ HasResourceClass "org.simantics.proconf.g3d.csg.stubs.CSGResource" : String\r
+ HasStubsPackage "org.simantics.proconf.g3d.csg.stubs" : String\r
+\r
+CSGNamespace : Namespace\r
+ PartOf TypeSystemNamespaces\r
+ HasNamespace "http://www.vtt.fi/Simantics/CSG/1.0" : URI\r
+ HasNamespaceRoot CSGOntology\r
+\r
+# Project\r
+CSGProjectType <T ProjectType\r
+CSGProject : CSGProjectType <T Project\r
+ PartOf ProjectTypes\r
+ \r
+CSGShape <T Shape\r
+CSGModel <T G3DModel\r
+Primitive <T CSGShape\r
+ [HasSizingProperty card "0..*"]\r
+HasMainShape <R HasGeometryDefinition\r
+ HasDomain [BooleanOperation]\r
+ HasRange [CSGShape]\r
+HasSecondaryShape <R HasGeometryDefinition\r
+ HasDomain [BooleanOperation]\r
+ HasRange [CSGShape]\r
+BooleanOperation <T CSGShape\r
+ [HasMainShape card "0..1"]\r
+ [HasSecondaryShape card "0..*"]\r
+Difference <T BooleanOperation\r
+Intersection <T BooleanOperation\r
+Union <T BooleanOperation\r
+HasSizingProperty <R HasNonTransformation\r
+HasXAxisSize @ "Has X Axis Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasYAxisSize @ "Has Y Axis Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasZAxisSize @ "Has Z Axis Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasXAxisMinimumSize @ "Has X Axis Minimum Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasZAxisMinimumSize @ "Has Z Axis Minimum Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasXAxisMaximumSize @ "Has X Axis Maximum Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasZAxisMaximumSize @ "Has Z Axis Maximum Size" <R HasSizingProperty\r
+ HasRange [Double]\r
+HasRadius <R HasSizingProperty\r
+ HasRange [Double]\r
+HasMajorRadius <R HasSizingProperty\r
+ HasRange [Double]\r
+HasMinorRadius <R HasSizingProperty\r
+ HasRange [Double]\r
+HasTopRadius <R HasSizingProperty\r
+ HasRange [Double]\r
+HasBottomRadius <R HasSizingProperty\r
+ HasRange [Double]\r
+HasHeight <R HasSizingProperty\r
+ HasRange [Double]\r
+HasCorners <R HasSizingProperty\r
+ HasRange [Integer]\r
+Box <T Primitive\r
+ [HasXAxisSize card "1"]\r
+ [HasYAxisSize card "1"]\r
+ [HasZAxisSize card "1"]\r
+Sphere <T Primitive\r
+ [HasRadius card "1"]\r
+Cone <T Primitive\r
+ [HasTopRadius card "1"]\r
+ [HasBottomRadius card "1"]\r
+ [HasHeight card "1"]\r
+Cylinder <T Primitive\r
+ [HasRadius card "1"]\r
+ [HasHeight card "1"]\r
+Barrel <T Primitive\r
+ [HasMinorRadius card "1"]\r
+ [HasMajorRadius card "1"]\r
+ [HasHeight card "1"]\r
+EllipticCylinder <T Primitive\r
+ [HasMinorRadius card "1"]\r
+ [HasMajorRadius card "1"]\r
+ [HasHeight card "1"]\r
+RegularPrism <T Primitive\r
+ [HasHeight card "1"]\r
+ [HasRadius card "1"]\r
+ [HasCorners card "1"]\r
+Torus <T Primitive\r
+ [HasMinorRadius card "1"]\r
+ [HasMajorRadius card "1"]\r
+RectangularSolid <T Primitive\r
+ [HasXAxisMinimumSize card "1"]\r
+ [HasXAxisMaximumSize card "1"]\r
+ [HasYAxisSize card "1"]\r
+ [HasZAxisMinimumSize card "1"]\r
+ [HasZAxisMaximumSize card "1"]\r
+\r
+csgViewpointLibrary @ "Viewpoint Library" : ViewpointLibrary\r
+ PartOf CSGOntology\r
+csgState @ _ : ViewpointState\r
+csgTraversalRule @ _ : RelationBasedTraversalRule\r
+ HasContext csgState\r
+ L0.HasTargetState csgState\r
+ AcceptsRelation HasChild\r
+csgAcceptRule @ _ : AcceptAllResourceAcceptRule\r
+CSGStructureViewpoint @ "CSG Structure Viewpoint" : ResourceViewpoint\r
+ HasInitialState csgState\r
+ HasTraversalRule csgTraversalRule\r
+ HasResourceAcceptRule csgAcceptRule\r
+ PartOf csgViewpointLibrary\r
--- /dev/null
+..\foundation_ontologies\r
+..\2d_ontologies\r
--- /dev/null
+%import "layer0.graph" \r
+%import "animation.graph"\r
+%import "image.graph" IMAGE\r
+%define symmetric()\r
+ $subject\r
+ $layer0.InverseOf $subject\r
+%define tag($tagname)\r
+ $subject\r
+ $tagname $subject\r
+%deflib Type _ @ "Types" : TypeLibrary\r
+ PartOf G3DOntology\r
+%deflib Relation _ @ "Relations" : RelationLibrary\r
+ PartOf G3DOntology\r
+%deflib Library G3DOntology\r
+G3DOntology @ "G3D Ontology" : Ontology\r
+ PartOf TypeSystemProject\r
+ HasNamespace "http://www.vtt.fi/Simantics/G3D/1.0" : URI\r
+ HasVersion "1.0" : Version\r
+ HasResourceClass "org.simantics.proconf.g3d.stubs.G3DResource" : String\r
+ HasStubsPackage "org.simantics.proconf.g3d.stubs" : String\r
+\r
+G3DNamespace @ "G3D Namespace" : Namespace\r
+ PartOf TypeSystemNamespaces\r
+ HasNamespace "http://www.vtt.fi/Simantics/G3D/1.0" : URI\r
+ HasNamespaceRoot G3DOntology\r
+\r
+HasTransformationValue <R HasProperty\r
+ InverseOf TransformationValueOf\r
+ HasRange [Double]\r
+HasX <R HasTransformationValue\r
+HasY <R HasTransformationValue\r
+HasZ <R HasTransformationValue\r
+HasAngle <R HasTransformationValue\r
+Tuple3 <T Property\r
+ [HasX card "1"]\r
+ [HasY card "1"]\r
+ [HasZ card "1"]\r
+Position <T Tuple3\r
+Center <T Tuple3\r
+Orientation <T Property\r
+ [HasX card "1"]\r
+ [HasY card "1"]\r
+ [HasZ card "1"]\r
+ [HasAngle card "1"]\r
+Transformation <T Property\r
+Position <T Transformation\r
+Orientation <T Transformation\r
+Center <T Transformation\r
+\r
+# Parent-child relationship\r
+HasChild <R IsRelatedTo\r
+ InverseOf HasParent\r
+ HasDomain [G3DNode]\r
+ HasRange [G3DNode]\r
+HasGeometryDefinition <R HasChild\r
+ InverseOf GeometryDefinitionOf\r
+\r
+# Properties of G3DNode are divided into transformation properties and non-transformation properties \r
+# All 3D properties must be inherited from these two. (Queries that update scene-graph require this) \r
+HasTransformation <R HasProperty\r
+ InverseOf TransformationOf\r
+HasNonTransformation <R HasProperty\r
+ InverseOf NonTransformationOf\r
+ \r
+HasLocalPosition <R HasTransformation\r
+ HasRange [Position]\r
+ InverseOf LocalPositionOf\r
+HasWorldPosition <R HasTransformation\r
+ HasRange [Position]\r
+ InverseOf WorldPositionOf\r
+HasLocalOrientation <R HasTransformation\r
+ HasRange [Orientation]\r
+ InverseOf LocalOrientationOf\r
+HasWorldOrientation <R HasTransformation\r
+ HasRange [Orientation]\r
+ InverseOf WorldOrientationOf\r
+HasCenter <R HasTransformation\r
+ HasRange [Center]\r
+G3DNode @ "G3DNode" <T Entity\r
+ [HasParent card "0..1"]\r
+ [HasChild card "0..*"]\r
+ [HasLocalPosition card "0..1"]\r
+ [HasWorldPosition card "0..1"]\r
+ [HasLocalOrientation card "0..1"]\r
+ [HasWorldOrientation card "0..1"]\r
+ [HasCenter card "0..1"]\r
+ HasDescription "Base node for scene-graph" : String\r
+ Includes\r
+ HasChild\r
+ Propagates\r
+ HasChild\r
+HasG3DNode @ "Has G3DNode" <R DependsOn\r
+ HasRange [G3DNode]\r
+HasRed <R HasProperty\r
+ HasRange [Double]\r
+HasGreen <R HasProperty\r
+ HasRange [Double]\r
+HasBlue <R HasProperty\r
+ HasRange [Double]\r
+HasTransparency <R HasProperty\r
+ HasRange [Double]\r
+HasShininess <R HasProperty\r
+ HasRange [Double]\r
+Color <T Entity\r
+ [HasRed card "1"]\r
+ [HasGreen card "1"]\r
+ [HasBlue card "1"]\r
+HasDiffuseColor <R IsRelatedTo\r
+ InverseOf DiffuseColorOf\r
+ HasRange [Color]\r
+HasSpecularColor <R IsRelatedTo\r
+ InverseOf SpecularColorOf\r
+ HasRange [Color]\r
+HasAmbientColor <R IsRelatedTo\r
+ InverseOf AmbientColorOf\r
+ HasRange [Color]\r
+HasEmissiveColor <R IsRelatedTo\r
+ InverseOf EmissiveColorOf\r
+ HasRange [Color]\r
+\r
+Material <T Entity\r
+ [HasDiffuseColor card "1"]\r
+ [HasSpecularColor card "1"]\r
+ [HasAmbientColor card "1"]\r
+ [HasEmissiveColor card "1"]\r
+ [HasTransparency card "1"]\r
+ [HasShininess card "1"]\r
+ Includes\r
+ HasDiffuseColor\r
+ HasSpecularColor\r
+ HasAmbientColor\r
+ HasEmissiveColor\r
+ HasTransparency\r
+ HasShininess\r
+ Propagates\r
+ HasDiffuseColor\r
+ HasSpecularColor\r
+ HasAmbientColor\r
+ HasEmissiveColor\r
+ HasTransparency\r
+ HasShininess\r
+TextureCoordinateGenerator <T Property\r
+ tag(Enumeration)\r
+HasTextureCoordinateGenerator <R DependsOn\r
+ HasRange [TextureCoordinateGenerator]\r
+TextureCoordinateGenerations : Library\r
+ ConsistsOf\r
+ _sphere @ "sphere" : TextureCoordinateGenerator\r
+ _eye_linear @ "eye linear" : TextureCoordinateGenerator\r
+ _object_linear @ "object linear" : TextureCoordinateGenerator\r
+ _normal @ "normal" : TextureCoordinateGenerator\r
+ _reflection @ "reflection" : TextureCoordinateGenerator\r
+\r
+TextureMode @ "MultiTexture Mode" <T Property\r
+ tag(Enumeration)\r
+ ConsistsOf\r
+ mt_add @ "add" : TextureMode\r
+ mt_modulate @ "modulate" : TextureMode\r
+ mt_blend @ "blend" : TextureMode\r
+ mt_decal @ "decal" : TextureMode\r
+ mt_replace @ "replace" : TextureMode\r
+ mt_combine @ "combine" : TextureMode\r
+HasTextureMode @ "Has Texture Mode" <R DependsOn\r
+ HasRange [TextureMode]\r
+ \r
+CombineMode <T Property\r
+ tag(Enumeration)\r
+ ConsistsOf\r
+ cm_add @ "add" : CombineMode\r
+ cm_replace @ "replace" : CombineMode\r
+ cm_modulate @ "modulate" : CombineMode\r
+ cm_add_signed @ "add signed" : CombineMode\r
+ cm_subtract @ "subtract" : CombineMode\r
+ cm_interpolate @ "interpolate" : CombineMode\r
+ cm_dot3 @ "dot3" : CombineMode\r
+#HasCombineMode <R DependsOn\r
+# HasRange [CombineMode]\r
+ \r
+CombineSource <T Property\r
+ tag(Enumeration)\r
+ ConsistsOf\r
+ cs_object_color @ "object color" : CombineSource\r
+ cs_texture_color @ "texture color" : CombineSource\r
+ cs_constant_color @ "constant color" : CombineSource\r
+ cs_previous_texture_state @ "previous state" : CombineSource\r
+ cs_texture0 @ "texture 0" : CombineSource\r
+ cs_texture1 @ "texture 1" : CombineSource\r
+#HasCombineSource <R DependsOn\r
+# HasRange [CombineSource]\r
+CombineFunction <T Property\r
+ tag(Enumeration)\r
+ ConsistsOf\r
+ cf_src_color @ "src color" : CombineFunction\r
+ cf_one_minus_src_color @ "one minus src color" : CombineFunction\r
+ cf_src_alpha @ "src alpha" : CombineFunction\r
+ cf_one_minus_src_alpha @ "one minus src alpha" : CombineFunction\r
+#HasCombineFunction <R DependsOn\r
+# HasRange [CombineFunction]\r
+\r
+HasCombineDefinition @ "Has Combine Definition" <R HasProperty\r
+ HasRange [LinkedList]\r
+ \r
+#MultiTextureElement @ "MultiTextureElement" <T Entity\r
+# [HasTexture card "1"]\r
+\r
+Texture <T Property\r
+ [HasTextureMode card "0..1"]\r
+ [HasCombineDefinition card "0..1"]\r
+ [HasTextureCoordinateGenerator card "0..1"]\r
+ #[HasCombineMode card "0..1"]\r
+ #[HasCombineSource card "0..1"]\r
+ #[HasCombineFunction card "0..1"]\r
+ \r
+HasTexture <R DependsOn\r
+ HasRange [Texture]\r
+ \r
+Texture1D @ "Texture1D" <T Texture\r
+Texture2D @ "Texture2D" <T Texture\r
+Texture3D @ "Texture3D" <T Texture\r
+CubeMapTexture @ "CubeMap Texture" <T Texture\r
+ \r
+#MultiTextureElementList @ "MultiTextureElementList" <T LinkedList\r
+#HasMultiTextureElementList @ "Has MultiTextureElementList" <R DependsOn : FunctionalRelation\r
+HasMultiTextureElementList @ "Has MultiTextureElementList" <R HasProperty\r
+ HasRange [LinkedList]\r
+ #HasRange [MultiTextureElementList]\r
+# this definition is incorrect: multitexture cannot have texturemode,m etc. itself\r
+MultiTexture @ "MultiTexture" <T Texture\r
+ [HasMultiTextureElementList card "1"]\r
+HasImage <R DependsOn\r
+ HasRange [IMAGE.Image]\r
+ImageTexture @ "ImageTexture" <T Texture2D\r
+ [HasImage card "1"]\r
+HasVertexShader <R HasProperty\r
+ HasRange [String]\r
+HasFragmentShader <R HasProperty\r
+ HasRange [String]\r
+Shader <T Entity\r
+ [HasVertexShader card "1"]\r
+ [HasFragmentShader card "1"]\r
+HasMaterial <R IsRelatedTo\r
+ HasRange [Material]\r
+HasShader <R IsRelatedTo\r
+ HasRange [Shader]\r
+Appearance <T Entity\r
+ [HasMaterial card "0..1"]\r
+ [HasTexture card "0..1"]\r
+ [HasShader card "0..1"]\r
+ Includes\r
+ HasMaterial\r
+ HasTexture\r
+ HasShader\r
+ Propagates\r
+ HasMaterial\r
+ HasTexture\r
+ HasShader\r
+HasAppearance <R HasProperty # HasNonTransformation \r
+ HasRange [Appearance]\r
+Shape <T G3DNode\r
+ [HasAppearance card "0..1"]\r
+ HasDescription "Node for representing geometries" : String\r
+ Includes\r
+ HasAppearance\r
+G3DModel @ "G3DModel" <T G3DNode\r
+ [HasAnimation card "0..*"]\r
+ [HasSizingParameter card "0..*"]\r
+ Includes\r
+ HasAnimation\r
+ HasSizingParameter\r
+ Propagates\r
+ HasAnimation\r
+ HasSizingParameter\r
+HasSizingParameter <R HasNonTransformation\r
+ HasDescription "Sizing parameters are used for defining parameterization of a model" : String\r
+ HasDomain [G3DModel]\r
+ HasRange [Double]\r
+HasDefaultDoubleValue <R HasProperty\r
+ HasDescription "Sizing Parameter's default value" : String\r
+ HasDomain [Double]\r
+ HasRange [Double]\r
+ \r
+HasConstraints <R HasAdapter2 : FunctionalRelation\r
+\r
+\r
--- /dev/null
+@echo off\r
+\r
+call "%~dp0..\og\generate2" "%~dp0" 3d.graph\r
--- /dev/null
+@echo off\r
+\r
+call "%~dp0..\og\generate2" "%~dp0" plant3d_product.graph || goto eof\r
+\r
+:eof
\ No newline at end of file
--- /dev/null
+scrub=org/simantics/proconf/g3d/stubs=../org.simantics.proconf.g3d/src\r
+scrub=org/simantics/proconf/g3d/csg/stubs=../org.simantics.proconf.g3d.csg/src\r
+scrub=org/simantics/processeditor/stubs=../org.simantics.proconf.processeditor/src\r
+\r
--- /dev/null
+HasNext\r
+HasPrevious\r
+%import "layer0.graph"\r
+%import "animation.graph"\r
+%import "g3d.graph"\r
+%define symmetric()\r
+ $subject\r
+ $layer0.InverseOf $subject\r
+%define tag($tagname)\r
+ $subject\r
+ $tagname $subject\r
+%deflib Type _ @ "Types" : TypeLibrary\r
+ PartOf Plant3DOntology\r
+%deflib Relation _ @ "Relations" : RelationLibrary\r
+ PartOf Plant3DOntology\r
+%deflib Library Plant3DOntology\r
+Plant3DOntology @ "Plant3D Ontology" : Ontology\r
+ PartOf TypeSystemProject\r
+ HasNamespace "http://www.vtt.fi/Simantics/Plant3D/1.0" : URI\r
+ HasVersion "1.0" : Version\r
+ HasResourceClass "org.simantics.processeditor.stubs.Plant3DResource" : String\r
+ HasStubsPackage "org.simantics.processeditor.stubs" : String\r
+\r
+Plant3DNamespace : Namespace\r
+ PartOf TypeSystemNamespaces\r
+ HasNamespace "http://www.vtt.fi/Simantics/Plant3D/1.0" : URI\r
+ HasNamespaceRoot Plant3DOntology\r
+ \r
+# Project\r
+Plant3DProjectType @ "Plant3DProjectType" <T ProjectType\r
+Plant3DProject @ "Plant3DProject" : Plant3DProjectType <T Project\r
+ PartOf ProjectTypes\r
+\r
+\r
+#****************************************************************************\r
+#\r
+# PBS structure and components\r
+#\r
+#****************************************************************************\r
+\r
+P3DNode @ "P3DNode" <T G3DNode\r
+ HasDescription "Base node for all 3D plant objects. Used as an identifier." : String\r
+PBSNode <T Entity\r
+ HasDescription "Plant Breakdown Structure super type" : String\r
+ HasDescription "Example: Site > Plant > Area > Unit" : String\r
+ [HasParentStructure card "0..1"]\r
+ [HasChildStructure card "0..*"]\r
+HasChildStructure <R IsRelatedTo\r
+ InverseOf HasParentStructure\r
+ HasDomain [PBSNode]\r
+ HasRange [PBSNode]\r
+Plant <T P3DNode <T PBSNode\r
+ HasDescription "Root node of the scene-graph" : String\r
+ HasDescription "Contains Equipment and Pipe Runs (Scene-graph)" : String\r
+ HasDescription "Scene-graph structure IS NOT Plant Breakdown Structure (PBS)" : String\r
+HasGraphics <R IsWeaklyRelatedTo\r
+ HasDescription "link to geometric representation of component or equipment" : String\r
+ HasRange [G3DModel]\r
+LibraryComponent <T P3DNode <T PBSNode\r
+ HasDescription "Base type for librarised components and equipment" : String\r
+ [HasGraphics card "0..1"]\r
+Equipment <T LibraryComponent\r
+ [HasNozzle card "0..1"]\r
+ [HasNozzleDefinition card "0..*"]\r
+ [HasNozzleRestriction card "0..1"]\r
+# TODO : PipeRun should link to Spec and use its information\r
+PipeRun <T P3DNode\r
+ HasDescription "Non visible node" : String\r
+ HasDescription "Contains all pipeline components that contain same specification (size, ..)" : String\r
+ [HasPipeDiameter card "1"]\r
+ [HasTurnRadius card "1"]\r
+ [HasControlPoints card "0..*"]\r
+Nozzle <T LibraryComponent\r
+ [HasPipeDiameter card "1"]\r
+ [HasLength card "1"]\r
+ [HasControlPoint card "0..1"] #0..1 prevents automatic instantion of control point\r
+PipelineComponent <T LibraryComponent\r
+ [HasPipeDiameter card "1"]\r
+ [HasControlPoint card "0..1"]\r
+SingleConnectedComponent <T PipelineComponent\r
+ HasDescription "A component that is connected to only one component" : String\r
+DualConnectedComponent <T PipelineComponent\r
+ HasDescription "A component that is connected to two components" : String\r
+MultiConnectedComponent <T PipelineComponent\r
+ HasDescription "A component that is connected to more than two components" : String\r
+InlineComponent <T PipelineComponent\r
+ HasDescription "Component that connects to two or more components, and maintains direction of (main) " : String\r
+ HasDescription "pipe run. Centerline of main pipeline may have offset: with offset there is two control " : String\r
+ HasDescription "points for main pipeline, and without offset, there is only one control point for main " : String\r
+ HasDescription "pipeline. The component may also join two pipe runs together: then there is always one " : String\r
+ HasDescription "control point for one pipe run." : String\r
+ [HasLength card "1"]\r
+EndComponent <T PipelineComponent\r
+ HasDescription "Component that ends the pipe run" : String\r
+ HasDescription "Component may contain other control points" : String\r
+TurnComponent <T PipelineComponent\r
+ HasDescription "Component that changes direction of the pipeline" : String\r
+ HasDescription "Component that connects to two or more components, and specifies connectivity of main " : String\r
+ HasDescription "pipe run. Is base type for elbows, pipe bends, etc., but also for components that won't " : String\r
+ HasDescription "maintain main pipeline direction (inline component). CHECK!!!" : String\r
+ [HasTurnAngle card "1"]\r
+FixedLengthInlineComponent <T InlineComponent\r
+ HasDescription "Inline component that has fixed length" : String\r
+ [HasRotationAngle card "1"]\r
+VariableLengthInlineComponent <T InlineComponent\r
+ HasDescription "Inline component whose length can be changed" : String\r
+FixedAngleTurnComponent <T TurnComponent\r
+ HasDescription "Turn Component that has specific turning angle that cannot be changed" : String\r
+ [HasRotationAngle card "1"]\r
+VariableAngleTurnComponent <T TurnComponent\r
+ HasDescription "Turn Component whose turning angle can be modified" : String\r
+ HasDescription "Contains always one control point (there are no contradictory cases / how to calculate?)" : String\r
+ [HasTurnRadius card "1"]\r
+SizeChangeComponent <T FixedLengthInlineComponent\r
+ HasDescription "Component that changes pipe run along main pipeline. (Spec change)" : String\r
+OffsetComponent <T FixedLengthInlineComponent\r
+ HasDescription "Component that offsets the center of piperun." : String \r
+CodedComponent <T PipelineComponent\r
+ HasDescription "Currently used with non-customizable / hard-coded components" : String\r
+NonVisibleComponent <T PipelineComponent\r
+ HasDescription "(Pseudo) Component that cannot bee seen." : String\r
+\r
+#****************************************************************************\r
+#\r
+# Pipe Control Points\r
+#\r
+#****************************************************************************\r
+\r
+# control point base type\r
+PipeControlPoint <T Entity\r
+ HasDescription "Base type" : String\r
+ [HasLocalPosition card "1"]\r
+ [HasWorldPosition card "1"]\r
+ [HasLocalOrientation card "1"]\r
+ [HasWorldOrientation card "1"]\r
+ [HasNext card "0..1"]\r
+ [HasPrevious card "0..1"]\r
+ [HasNext card "0..1"]\r
+ [HasSubPoint card "0..*"]\r
+ [SubPointOf card "0..1"]\r
+ [HasPipeDiameter card "1"]\r
+ [ControlPointOf card "0..1"]\r
+ [ControlPointOfPipeRun card "0..1"]\r
+\r
+# divide to path leg ends and inline\r
+PathLegEndControlPoint <T PipeControlPoint\r
+ HasDescription "A control point that ends path leg." : String\r
+InlineControlPoint <T PipeControlPoint\r
+ [HasLength card "1"]\r
+\r
+# turns\r
+TurnControlPoint <T PathLegEndControlPoint\r
+ [HasTurnAngle card "1"]\r
+ [HasLength card "1"] # TODO : should this be length or something else?\r
+ \r
+FixedAngleTurnControlPoint <T TurnControlPoint #is this unnecessary ( Fixed angle could be created with EndComponent + Directed as a subpoint)? \r
+ HasDescription "While variable angle turn control point is positioned by path legs, user is responsible for rotating fixed angle turn components." : String\r
+ [HasRotationAngle card "1"]\r
+ [IsReversed card "1"]\r
+VariableAngleTurnControlPoint <T TurnControlPoint\r
+ [HasTurnRadius card "1"]\r
+ [HasTurnAxis card "1"] # this was for update purposes\r
+# inline\r
+VariableLengthControlPoint <T InlineControlPoint\r
+FixedLengthControlPoint <T InlineControlPoint\r
+ [HasRotationAngle card "1"]\r
+\r
+RunEndControlPoint <T PathLegEndControlPoint\r
+ HasDescription "Control Point that ends a PipeRun." : String\r
+ HasDescription "Only Next or Previous ControlPoint must be set, and other must be end" : String\r
+\r
+# directed and undirected\r
+\r
+DirectedControlPoint <T RunEndControlPoint\r
+ [HasLocalOrientation card "1"]\r
+ [HasWorldOrientation card "1"]\r
+# [HasDirection card "1"]\r
+UndirectedControlPoint <T RunEndControlPoint\r
+\r
+EndComponentControlPoint <T UndirectedControlPoint\r
+ [HasRotationAngle card "1"]\r
+ \r
+# for N-Port components (N > 3), defines position and direction of control point relative to main control point \r
+NPortControlPoint <T DirectedControlPoint\r
+# [HasRelativePosition card "1"]\r
+# [HasRelativeDirection card "1"] \r
+\r
+# Size change & Offset\r
+# TODO: could we allow variable length components that offset piperun ? (currently only component that is variable length is straight pipe, so for now: no) \r
+# note: SizeChange actually ends a piperun, but allows path leg to continue\r
+DualInlineControlPoint <T FixedLengthControlPoint\r
+ HasDescription "FixedLengthInlineControlPoint that has subcontrolpoint in the same PipeRun/Pathleg." : String\r
+ HasDescription "The previous controlpoint is connected (next) to this point and the next point is connected (previous) to subpoint, while this point and the subpoint are connected both the previous and the next point." : String\r
+SizeChangeControlPoint <T DualInlineControlPoint\r
+ HasDescription "Changes PipeRun within the path leg." : String\r
+ HasDescription "This CP belongs to the PipeRun that is the previous side and subpoint belongs to the PipeRun that is on the next side." : String \r
+OffsettingPoint <T DualInlineControlPoint\r
+ [HasOffset card "1"]\r
+ HasDescription "Offsets the center of the pipe." : String \r
+DualSubControlPoint <T FixedLengthControlPoint\r
+ HasDescription "DualInlineControlPoint's subpoint." : String\r
+\r
+# nozzle must have its own control point so that we know to link pipe diameters of the nozzle and the piperun\r
+NozzleControlPoint <T DirectedControlPoint\r
+\r
+# TODO : is it necessary to model inline control point that has no length?\r
+BranchEndControlPoint <T UndirectedControlPoint\r
+BranchControlPoint <T FixedLengthControlPoint\r
+\r
+# TODO : we also need a way to specify if control point can be moved from its current place or not (this may be dynamic)\r
+ \r
+\r
+# relation and property definitions\r
+\r
+HasControlPoint <R IsRelatedTo\r
+ InverseOf ControlPointOf\r
+ HasDomain [(PipelineComponent or Nozzle)]\r
+ HasRange [PipeControlPoint]\r
+ HasDescription "Relation between PipelineComponent and ControlPoint" : String\r
+HasControlPoints <R IsRelatedTo\r
+ InverseOf ControlPointOfPipeRun\r
+ HasDomain [PipeRun]\r
+ HasRange [PipeControlPoint]\r
+ HasDescription "Relation between PipeRun and ControlPoint" : String\r
+ HasDescription "This is needed because a PipeLineComponent may contain multiple ControlPoints that belong to different PipeRuns." : String\r
+HasNext <R IsWeaklyRelatedTo\r
+ HasDomain [PipeControlPoint]\r
+ HasRange [PipeControlPoint]\r
+ HasDescription "Next point in the piperun" : String\r
+HasPrevious <R IsWeaklyRelatedTo\r
+ HasDomain [PipeControlPoint]\r
+ HasRange [PipeControlPoint]\r
+ HasDescription "Previous point in the piperun" : String\r
+HasSubPoint @ "Has SubPoint" <R IsRelatedTo\r
+ InverseOf SubPointOf\r
+ HasDomain [PipeControlPoint]\r
+ HasRange [PipeControlPoint]\r
+ HasDescription "Subcontrolpoint's position is defined by its parent control point. Local Position of subpoint is its position relative to its parent point similar to child/parent relationship in scene-graph." : String \r
+\r
+HasPipeDiameter <R HasNonTransformation\r
+ HasRange [Double]\r
+HasLength <R HasNonTransformation\r
+ HasRange [Double]\r
+HasTurnAngle <R HasNonTransformation\r
+ HasRange [Double]\r
+HasRotationAngle <R HasTransformation\r
+ HasRange [Double]\r
+HasOffset <R HasProperty\r
+ HasRange [Double]\r
+#HasRelativePosition <R HasProperty\r
+# HasRange [Position]\r
+#HasRelativeDirection <R HasProperty\r
+# HasRange [Tuple3]\r
+#HasDirection <R HasProperty\r
+# HasRange [Tuple3] \r
+HasTurnRadius <R HasNonTransformation\r
+ HasRange [Double] \r
+IsReversed <R HasProperty\r
+ HasRange [Boolean]\r
+HasTurnAxis <R HasTransformation\r
+ HasRange [Tuple3]\r
+ \r
+HasNozzleDefinition <R HasProperty\r
+ HasDomain [Equipment]\r
+ HasRange [Nozzle]\r
+ HasDescription "This relation is used to connect nozzles to equipment in the template. For instantiated equipment nozzles must be connected with HasNozzle relation." : String \r
+HasNozzle <R HasChild\r
+ InverseOf NozzleOf\r
+ HasDomain [Equipment]\r
+ HasRange [Nozzle]\r
+ HasDescription "Used to connect nozzles to equipment." : String\r
+HasNozzleRestriction <R HasMultiplicity\r
+ HasDescription "Used in template equipment to restrict amount of nozzles." : String\r
+ HasDescription "If template has as many nozzleDefinitions that maximum count in this restriction, user cannot add new nozzles to the equipment instance." : String\r
+\r
+\r
+\r
+#****************************************************************************\r
+#\r
+# Predefined equipment and components\r
+#\r
+#**************************************************************************** \r
+ \r
+ \r
+Reducer <T CodedComponent <T SizeChangeComponent <T FixedLengthInlineComponent <T DualConnectedComponent\r
+#ConcentricReducer <T Reducer\r
+#ConcentricReducerImpl : ConcentricReducer\r
+ConcentricReducer <T Reducer : Reducer\r
+ PartOf Plant3DOntology\r
+ HasRotationAngle "0.0" : Double\r
+ HasControlPoint \r
+ _ : SizeChangeControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasSubPoint\r
+ _ : DualSubControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double \r
+#EccentricReducer <T Reducer <T OffsetComponent\r
+#EccentricReducerImpl : EccentricReducer\r
+EccentricReducer <T Reducer <T OffsetComponent : Reducer : OffsetComponent\r
+ PartOf Plant3DOntology\r
+ HasRotationAngle "0.0" : Double\r
+ HasControlPoint \r
+ _ : SizeChangeControlPoint : OffsettingPoint\r
+ HasOffset "1.0" : Double #TODO : define an equation that can calculate the offset form pipediameters. This requires relative \r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasSubPoint\r
+ _ : DualSubControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+#Elbow <T CodedComponent <T VariableAngleTurnComponent <T DualConnectedComponent\r
+#ElbowImpl : Elbow\r
+Elbow <T CodedComponent <T VariableAngleTurnComponent <T DualConnectedComponent : CodedComponent : VariableAngleTurnComponent : DualConnectedComponent\r
+ PartOf Plant3DOntology\r
+ HasLength "0.0" : Double\r
+ HasTurnRadius "0.0" : Double\r
+ HasTurnAngle "0.0" : Double\r
+ HasControlPoint \r
+ _ : VariableAngleTurnControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double \r
+#Straight <T CodedComponent <T DualConnectedComponent <T VariableLengthInlineComponent\r
+#StraightImpl : Straight\r
+Straight <T CodedComponent <T DualConnectedComponent <T VariableLengthInlineComponent : CodedComponent : DualConnectedComponent : VariableLengthInlineComponent\r
+ PartOf Plant3DOntology\r
+ HasLength "0.0" : Double\r
+ HasControlPoint \r
+ _ : VariableLengthControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double \r
+ \r
+BranchSplitComponent <T FixedLengthInlineComponent <T NonVisibleComponent : FixedLengthInlineComponent : NonVisibleComponent \r
+ PartOf Plant3DOntology\r
+ HasLength "0.0" : Double \r
+ HasControlPoint\r
+ _ : BranchControlPoint\r
+ HasWorldPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasWorldOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ HasLocalPosition\r
+ _ : Position\r
+ HasX "0.0" : Double\r
+ HasY "0.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasLocalOrientation\r
+ _ : Orientation\r
+ HasX "0.0" : Double\r
+ HasY "1.0" : Double\r
+ HasZ "0.0" : Double\r
+ HasAngle "0.0" : Double\r
+ \r
+#Tee <T FixedLengthInlineComponent <T MultiConnectedComponent\r
+#BendPipe <T PipeComponent <T VariableAngleTurnComponent <T DualConnectedComponent\r
+#Cap <T EndComponent\r
+#BlindFlange <T EndComponent\r
+#TwoWayBallValve <T FixedLengthInlineComponent <T DualConnectedComponent\r
+#ThreeWayTTypeBallValve <T FixedLengthInlineComponent <T MultiConnectedComponent\r
+# HasName "Three Way T Type Ball Valve" : String\r
+#ThreeWayYType120DegreeBallValve <T EndComponent <T MultiConnectedComponent\r
+# HasName "Three Way Y Type 120 Degree Ball Valve" : String\r
+Vessel <T Equipment\r
+VerticalVessel <T Vessel\r
+ [HasHeight card "1"]\r
+HorizontalVessel <T Vessel\r
+ [HasLength card "1"]\r
+\r
+HasHeight <R HasNonTransformation\r
+ HasRange [Double]\r
+HasLength <R HasNonTransformation\r
+ HasRange [Double]\r
+\r
+#****************************************************************************\r
+#\r
+# Specs \r
+#\r
+#****************************************************************************\r
+\r
--- /dev/null
+%import "foundation.graph"\r
+\r
+%import "csg.graph"\r
+%import "equation.graph"\r
+%import "plant3d.graph"
\ No newline at end of file
unpack="false"/>\r
\r
<plugin\r
- id="fi.vtt.simantics.processeditor"\r
+ id="org.simantics.processeditor"\r
download-size="0"\r
install-size="0"\r
version="0.0.0"\r
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.simantics.proconf.g3d,
- org.simantics.g2d.stubs,
org.simantics.db,
org.simantics.layer0.utils,
org.simantics.layer0.stubs,
- org.simantics.utils.datastructures
+ org.simantics.utils.datastructures,
+ org.simantics.animation
ipse-LazyStart: true
Export-Package: org.simantics.proconf.g3d.csg.stubs
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.GeometryProvider;\r
import org.simantics.proconf.g3d.occ.OccResources;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.eclipse.test.ply.PLY_Loader;\r
import com.jme.scene.Geometry;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
org.simantics.image.stubs,
org.simantics.layer0.stubs,
org.simantics.layer0.utils,
- org.simantics.g2d.stubs,
org.simantics.utils,
org.simantics.proconf.g3d.occ,
org.simantics.proconf.ui,
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.db.Builtins;\r
import org.simantics.db.Graph;\r
import org.simantics.equation.stubs.EquationResource;\r
-import org.simantics.g2d.stubs.anim.AnimationResource;\r
+import org.simantics.animation.stubs.AnimationResource;\r
import org.simantics.animation.curve.CurveBuilder;\r
import org.simantics.animation.curve.CurveBuilderImpl;\r
import org.simantics.proconf.g3d.stubs.G3DResource;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.actions;\r
\r
import java.io.File;\r
import org.simantics.layer0.utils.serialization.TransferableGraph;\r
import org.simantics.layer0.utils.serialization.TransferableGraphUtils;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
\r
public class ExportAction extends Action{\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.actions;\r
\r
import java.io.BufferedInputStream;\r
import org.simantics.layer0.utils.serialization.TransferableGraph;\r
import org.simantics.layer0.utils.serialization.TransferableGraphUtils;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
public class ImportAction extends Action {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.dialogs;\r
\r
import java.util.List;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.tools;\r
\r
import java.util.ArrayList;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.GraphRequestWithResult;\r
import org.simantics.db.Resource;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
-import org.simantics.g2d.stubs.anim.ScalarInterpolator;\r
-import org.simantics.g2d.stubs.anim.SlerpInterpolator;\r
+import org.simantics.animation.stubs.Animation;\r
+import org.simantics.animation.stubs.Interpolator;\r
+import org.simantics.animation.stubs.ScalarInterpolator;\r
+import org.simantics.animation.stubs.SlerpInterpolator;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.Property;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.stubs.Orientation;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
public class AnimationContribution implements EditorContribution {\r
List<ContextAction> actions = new ArrayList<ContextAction>();\r
}\r
Animation animation = getAnimation(graph);\r
Collection<Interpolator> interpolators = animation.getInterpolator();\r
- for (org.simantics.g2d.stubs.anim.Interpolator interpolator : interpolators) {\r
+ for (org.simantics.animation.stubs.Interpolator interpolator : interpolators) {\r
IEntity target = interpolator.getTarget();\r
// check all model properties\r
G3DModel model = parent.getModel(graph);\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.tools;\r
\r
import java.util.ArrayList;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
import org.simantics.proconf.g3d.stubs.Shape;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
public class CSGModellingContribution implements EditorContribution {\r
\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.tools;\r
\r
import java.util.ArrayList;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
import org.simantics.equation.stubs.SecondOrderScalarPolynomial;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
+import org.simantics.animation.stubs.Animation;\r
+import org.simantics.animation.stubs.Interpolator;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.ResourceDebugUtils;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
import org.simantics.equation.stubs.SecondOrderScalarPolynomial;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
+import org.simantics.animation.stubs.Animation;\r
+import org.simantics.animation.stubs.Interpolator;\r
import org.simantics.layer0.utils.ResourceDebugUtils;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.EntityFactory;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
import org.simantics.proconf.g3d.stubs.Shape;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.ui.jface.MenuTools;\r
\r
public class ShapeEditorBase extends ThreeDimensionalEditorBase {\r
\r
}\r
}\r
-\r
- public StructuredResourceSelection filterSelection(ISelection selection) {\r
- if (!(selection instanceof StructuredResourceSelection))\r
- return new StructuredResourceSelection();\r
- return (StructuredResourceSelection) selection;\r
- }\r
-\r
}\r
\r
/**\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.shapeeditor.views;\r
\r
import org.simantics.db.Resource;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
Bundle-Vendor: VTT
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.simantics.g2d.stubs,
javax.vecmath,
com.jme.eclipse,
org.simantics.proconf.image,
<?eclipse version="3.2"?>\r
<plugin>\r
<extension-point id="geometry" name="Geometry" schema="schema/geometry.exsd"/>\r
+ <extension-point id="appearance" name="Appearance" schema="schema/appearance.exsd"/>\r
<extension\r
point="org.eclipse.ui.preferencePages">\r
<page\r
type="org.eclipse.jface.viewers.IStructuredSelection">\r
</propertyTester>\r
</extension>\r
+ <extension\r
+ point="org.simantics.proconf.g3d.appearance">\r
+ <Appearance\r
+ class="org.simantics.proconf.g3d.base.DefaultAppearanceProvider"\r
+ id="org.simantics.proconf.g3d.Appearance1">\r
+ </Appearance>\r
+ </extension>\r
</plugin>\r
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>\r
+<!-- Schema file written by PDE -->\r
+<schema targetNamespace="org.simantics.proconf.g3d" xmlns="http://www.w3.org/2001/XMLSchema">\r
+<annotation>\r
+ <appinfo>\r
+ <meta.schema plugin="org.simantics.proconf.g3d" id="appearance" name="appearance"/>\r
+ </appinfo>\r
+ <documentation>\r
+ [Enter description of this extension point.]\r
+ </documentation>\r
+ </annotation>\r
+\r
+ <element name="extension">\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.element />\r
+ </appinfo>\r
+ </annotation>\r
+ <complexType>\r
+ <sequence>\r
+ <element ref="Appearance" minOccurs="0" maxOccurs="unbounded"/>\r
+ </sequence>\r
+ <attribute name="point" type="string" use="required">\r
+ <annotation>\r
+ <documentation>\r
+ \r
+ </documentation>\r
+ </annotation>\r
+ </attribute>\r
+ <attribute name="id" type="string">\r
+ <annotation>\r
+ <documentation>\r
+ \r
+ </documentation>\r
+ </annotation>\r
+ </attribute>\r
+ <attribute name="name" type="string">\r
+ <annotation>\r
+ <documentation>\r
+ \r
+ </documentation>\r
+ <appinfo>\r
+ <meta.attribute translatable="true"/>\r
+ </appinfo>\r
+ </annotation>\r
+ </attribute>\r
+ </complexType>\r
+ </element>\r
+\r
+ <element name="Appearance">\r
+ <complexType>\r
+ <attribute name="id" type="string" use="required">\r
+ <annotation>\r
+ <documentation>\r
+ \r
+ </documentation>\r
+ </annotation>\r
+ </attribute>\r
+ <attribute name="class" type="string" use="required">\r
+ <annotation>\r
+ <documentation>\r
+ \r
+ </documentation>\r
+ <appinfo>\r
+ <meta.attribute kind="java" basedOn=":org.simantics.proconf.g3d.base.AppearanceProvider"/>\r
+ </appinfo>\r
+ </annotation>\r
+ </attribute>\r
+ </complexType>\r
+ </element>\r
+\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.section type="since"/>\r
+ </appinfo>\r
+ <documentation>\r
+ [Enter the first release in which this extension point appears.]\r
+ </documentation>\r
+ </annotation>\r
+\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.section type="examples"/>\r
+ </appinfo>\r
+ <documentation>\r
+ [Enter extension point usage example here.]\r
+ </documentation>\r
+ </annotation>\r
+\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.section type="apiinfo"/>\r
+ </appinfo>\r
+ <documentation>\r
+ [Enter API information here.]\r
+ </documentation>\r
+ </annotation>\r
+\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.section type="implementation"/>\r
+ </appinfo>\r
+ <documentation>\r
+ [Enter information about supplied implementation of this extension point.]\r
+ </documentation>\r
+ </annotation>\r
+\r
+\r
+</schema>\r
<?xml version='1.0' encoding='UTF-8'?>\r
<!-- Schema file written by PDE -->\r
-<schema targetNamespace="org.simantics.proconf.g3d">\r
+<schema targetNamespace="org.simantics.proconf.g3d" xmlns="http://www.w3.org/2001/XMLSchema">\r
<annotation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.schema plugin="org.simantics.proconf.g3d" id="geometry" name="Geometry"/>\r
- </appInfo>\r
+ </appinfo>\r
<documentation>\r
[Enter description of this extension point.]\r
</documentation>\r
</annotation>\r
\r
<element name="extension">\r
+ <annotation>\r
+ <appinfo>\r
+ <meta.element />\r
+ </appinfo>\r
+ </annotation>\r
<complexType>\r
<sequence>\r
<element ref="Geometry" minOccurs="0" maxOccurs="unbounded"/>\r
<documentation>\r
\r
</documentation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.attribute translatable="true"/>\r
- </appInfo>\r
+ </appinfo>\r
</annotation>\r
</attribute>\r
</complexType>\r
<documentation>\r
\r
</documentation>\r
- <appInfo>\r
- <meta.attribute kind="java" basedOn=":fi.vtt.simantics.g3d.base.GeometryProvider"/>\r
- </appInfo>\r
+ <appinfo>\r
+ <meta.attribute kind="java" basedOn=":org.simantics.proconf.g3d.base.GeometryProvider"/>\r
+ </appinfo>\r
</annotation>\r
</attribute>\r
</complexType>\r
</element>\r
\r
<annotation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.section type="since"/>\r
- </appInfo>\r
+ </appinfo>\r
<documentation>\r
[Enter the first release in which this extension point appears.]\r
</documentation>\r
</annotation>\r
\r
<annotation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.section type="examples"/>\r
- </appInfo>\r
+ </appinfo>\r
<documentation>\r
[Enter extension point usage example here.]\r
</documentation>\r
</annotation>\r
\r
<annotation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.section type="apiInfo"/>\r
- </appInfo>\r
+ </appinfo>\r
<documentation>\r
[Enter API information here.]\r
</documentation>\r
</annotation>\r
\r
<annotation>\r
- <appInfo>\r
+ <appinfo>\r
<meta.section type="implementation"/>\r
- </appInfo>\r
+ </appinfo>\r
<documentation>\r
[Enter information about supplied implementation of this extension point.]\r
</documentation>\r
</annotation>\r
\r
- <annotation>\r
- <appInfo>\r
- <meta.section type="copyright"/>\r
- </appInfo>\r
- <documentation>\r
- \r
- </documentation>\r
- </annotation>\r
\r
</schema>\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
\r
import org.simantics.db.Graph;\r
import org.simantics.equation.stubs.EquationResource;\r
-import org.simantics.g2d.stubs.anim.AnimationResource;\r
+import org.simantics.animation.stubs.AnimationResource;\r
import org.simantics.animation.curve.CurveBuilder;\r
import org.simantics.animation.curve.CurveBuilderImpl;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.proconf.g3d.base;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.layer0.utils.IEntity;\r
+\r
+import com.jme.renderer.Renderer;\r
+import com.jme.scene.state.RenderState;\r
+\r
+\r
+/**\r
+ * Interface for Appearance / Material\r
+ * \r
+ * \r
+ * @author Marko Luukkainen\r
+ *\r
+ */\r
+public interface AppearanceProvider {\r
+ \r
+ /**\r
+ * Used to check if GeometryProvider can generate mesh\r
+ * @param instance\r
+ * @return\r
+ */\r
+ public boolean canHandle(IEntity instance);\r
+ \r
+ /**\r
+ * Generates mesh\r
+ * @param instance\r
+ * @param transform\r
+ * @return\r
+ */\r
+ public Collection<RenderState> getAppearanceFromResource(IEntity instance, Renderer renderer);\r
+ \r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.proconf.g3d.base;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.eclipse.core.runtime.CoreException;\r
+import org.eclipse.core.runtime.IConfigurationElement;\r
+import org.eclipse.core.runtime.IExtension;\r
+import org.eclipse.core.runtime.IExtensionPoint;\r
+import org.eclipse.core.runtime.Platform;\r
+import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker;\r
+import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler;\r
+import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;\r
+import org.eclipse.core.runtime.dynamichelpers.IFilter;\r
+import org.simantics.db.Resource;\r
+import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.utils.ui.ErrorLogger;\r
+\r
+import com.jme.renderer.Renderer;\r
+import com.jme.scene.state.RenderState;\r
+\r
+public class AppearanceProviderRegistry implements IExtensionChangeHandler {\r
+ private static AppearanceProviderRegistry instance;\r
+ //public final static String ELEMENT_NAME = "Appearance";\r
+ public final static String NAMESPACE = "org.simantics.proconf.g3d";\r
+ public final static String EP_NAME = "appearance";\r
+ \r
+ private ExtensionTracker tracker;\r
+ \r
+ private List<AppearanceProviderExtension> extensions = new ArrayList<AppearanceProviderExtension>();\r
+ //private Map<Resource,AppearanceProvider> providers;\r
+ \r
+ private AppearanceProviderRegistry() {\r
+ //providers = new HashMap<Resource,AppearanceProvider>();\r
+ \r
+ tracker = new ExtensionTracker();\r
+ \r
+ IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(NAMESPACE,EP_NAME);\r
+ loadExtensions(ep.getConfigurationElements());\r
+ \r
+ IFilter filter = ExtensionTracker.createExtensionPointFilter(ep);\r
+ tracker.registerHandler(this, filter);\r
+ }\r
+ \r
+ private void close() {\r
+ tracker.close();\r
+ tracker = null;\r
+ extensions = new ArrayList<AppearanceProviderExtension>();\r
+ }\r
+ \r
+ public static synchronized AppearanceProviderRegistry getInstance() {\r
+ if (instance==null) instance = new AppearanceProviderRegistry();\r
+ return instance;\r
+ }\r
+ \r
+ public static synchronized void dispose() {\r
+ if (instance != null) {\r
+ instance.close();\r
+ instance = null;\r
+ } \r
+ }\r
+ \r
+ public synchronized List<AppearanceProviderExtension> getExtensions() {\r
+ return Collections.unmodifiableList(extensions);\r
+ }\r
+ \r
+ private synchronized void loadExtensions(IConfigurationElement[] elements) {\r
+ for (IConfigurationElement el : elements) {\r
+ String id = el.getAttribute("id");\r
+ try {\r
+ Object o = el.createExecutableExtension("class");\r
+ AppearanceProviderExtension ext = new AppearanceProviderExtension(id,(AppearanceProvider)o);\r
+ tracker.registerObject(el.getDeclaringExtension(), ext, IExtensionTracker.REF_STRONG);\r
+ extensions.add(ext);\r
+ } catch (CoreException e) {\r
+ ErrorLogger.defaultLogError("Cannot create java interface for GeometryProvider " + id, e);\r
+ }\r
+ }\r
+ }\r
+ \r
+// private Map<Resource,AppearanceProvider> getProviderMap() {\r
+// return providers;\r
+// }\r
+ \r
+ public static Collection<RenderState> getAppearance(IEntity thing, Renderer renderer) {\r
+ AppearanceProvider provider = getAppearanceProvider(thing);\r
+ return provider.getAppearanceFromResource(thing, renderer);\r
+ }\r
+ \r
+ public static AppearanceProvider getAppearanceProvider(IEntity thing) {\r
+ //Collection<IEntity> types = thing.getRelatedObjects(thing.getGraph().getBuiltins().InstanceOf);\r
+ \r
+ //Resource types[] = OntologyUtils.getTypes(resource);\r
+// for (IEntity t : types) {\r
+ //AppearanceProvider provider = getInstance().getProviderMap().get(t.getResource());\r
+ //if (provider == null) {\r
+ //for (Extension<GeometryProvider> e : getInstance().getExtensions()) {\r
+ for (AppearanceProviderExtension e : getInstance().getExtensions()) {\r
+ if (e.provider.canHandle(thing)) {\r
+ //getInstance().getProviderMap().put(t.getResource(), e.provider);\r
+ return e.provider;\r
+ }\r
+ }\r
+ \r
+// } else {\r
+// return provider;\r
+// }\r
+// }\r
+ \r
+ return null;\r
+ }\r
+ \r
+ @Override\r
+ public void addExtension(IExtensionTracker tracker, IExtension extension) {\r
+ loadExtensions(extension.getConfigurationElements());\r
+ }\r
+ \r
+ @Override\r
+ public synchronized void removeExtension(IExtension extension, Object[] objects) {\r
+ for (Object o : objects) {\r
+ AppearanceProviderExtension ext = (AppearanceProviderExtension) o;\r
+ tracker.unregisterObject(extension, ext);\r
+ extensions.remove(ext);\r
+ }\r
+ }\r
+ \r
+ public class AppearanceProviderExtension {\r
+ public String id;\r
+ public AppearanceProvider provider;\r
+ \r
+ public AppearanceProviderExtension(String id, AppearanceProvider provider) {\r
+ this.id = id;\r
+ this.provider = provider;\r
+ }\r
+ }\r
+}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.g3d.Resources;\r
import org.simantics.proconf.g3d.stubs.Appearance;\r
import org.simantics.proconf.g3d.stubs.Color;\r
-import org.simantics.proconf.g3d.stubs.G3DResource;\r
import org.simantics.proconf.g3d.stubs.ImageTexture;\r
import org.simantics.proconf.g3d.stubs.Material;\r
import org.simantics.proconf.g3d.stubs.MultiTexture;\r
import org.simantics.proconf.g3d.stubs.MultiTextureMode;\r
import org.simantics.proconf.g3d.stubs.Shader;\r
import org.simantics.proconf.g3d.stubs.Texture;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.image.Image;\r
import com.jme.renderer.ColorRGBA;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
import java.util.ArrayList;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.db.Resource;\r
import org.simantics.db.adaption.AdaptionException;\r
import org.simantics.proconf.g3d.Resources;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.renderer.ColorRGBA;\r
import com.jme.scene.Geometry;\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.proconf.g3d.base;\r
+\r
+import java.util.Collection;\r
+\r
+import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.proconf.g3d.Resources;\r
+import org.simantics.proconf.g3d.stubs.Appearance;\r
+\r
+import com.jme.renderer.Renderer;\r
+import com.jme.scene.state.RenderState;\r
+\r
+public class DefaultAppearanceProvider implements AppearanceProvider {\r
+ \r
+ \r
+\r
+ @Override\r
+ public boolean canHandle(IEntity instance) {\r
+ return instance.hasStatement(Resources.g3dResource.HasAppearance);\r
+ }\r
+ \r
+ @Override\r
+ public Collection<RenderState> getAppearanceFromResource(IEntity instance, Renderer renderer) {\r
+ Collection<IEntity> appearanceResource;\r
+ if ((appearanceResource = instance.getRelatedObjects(Resources.g3dResource.HasAppearance)) != null && appearanceResource.size() > 0) {\r
+ return AppearanceTools.getAppearance(new Appearance(instance.getGraph(),appearanceResource.iterator().next().getResource()), renderer);\r
+ }\r
+ throw new RuntimeException("Given instance does not have Appearance definition!");\r
+ }\r
+}\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
import java.util.Collection;\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.proconf.g3d.base;\r
+\r
+import org.eclipse.ui.IPartListener;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+\r
+/**\r
+ * IPartListener that allows editor to load its content after the editorPart is activated.\r
+ * \r
+ * This is crucial with 3D graphics, which does not work if the editor part is activated\r
+ * after the data has been loaded.\r
+ * \r
+ * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
+ *\r
+ */\r
+public abstract class EditorLoader implements IPartListener {\r
+\r
+ boolean opened = false;\r
+ boolean activated = false;\r
+ \r
+ public void partOpened(IWorkbenchPart part) {\r
+ if (part.equals(getWorkbechPart())) {\r
+ opened = true;\r
+ }\r
+ }\r
+ \r
+ public void partActivated(IWorkbenchPart part) {\r
+ if (part.equals(getWorkbechPart())) {\r
+ if (opened & !activated) {\r
+ activated = true;\r
+ load();\r
+ }\r
+ }\r
+ }\r
+ \r
+ public void partBroughtToTop(IWorkbenchPart part) {}\r
+ \r
+ public void partClosed(IWorkbenchPart part) {}\r
+ \r
+ public void partDeactivated(IWorkbenchPart part) {}\r
+ \r
+ /**\r
+ * Returns the IWorkbenchPart of the editor\r
+ * @return\r
+ */\r
+ public abstract IWorkbenchPart getWorkbechPart();\r
+ \r
+ /**\r
+ * Starts the content loading process\r
+ */\r
+ public abstract void load();\r
+}\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
import javax.vecmath.AxisAngle4d;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
*******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
+import java.util.ArrayList;\r
import java.util.Collection;\r
+import java.util.Collections;\r
import java.util.HashMap;\r
+import java.util.List;\r
import java.util.Map;\r
\r
+import org.eclipse.core.runtime.CoreException;\r
+import org.eclipse.core.runtime.IConfigurationElement;\r
+import org.eclipse.core.runtime.IExtension;\r
+import org.eclipse.core.runtime.IExtensionPoint;\r
+import org.eclipse.core.runtime.Platform;\r
+import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker;\r
+import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler;\r
+import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;\r
+import org.eclipse.core.runtime.dynamichelpers.IFilter;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.IEntity;\r
-import org.simantics.utils.ui.plugin.Extension;\r
-import org.simantics.utils.ui.plugin.ExtensionLoader;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.scene.Geometry;\r
\r
-public class GeometryProviderRegistry {\r
+public class GeometryProviderRegistry implements IExtensionChangeHandler {\r
private static GeometryProviderRegistry instance;\r
public final static String ELEMENT_NAME = "Geometry";\r
- public final static String NAME_SPACE = "org.simantics.proconf.g3d";\r
+ public final static String NAMESPACE = "org.simantics.proconf.g3d";\r
public final static String EP_NAME = "geometry";\r
\r
- private ExtensionLoader<GeometryProvider> loader;\r
+ private ExtensionTracker tracker;\r
+ \r
+ private List<GeometryProviderExtension> extensions = new ArrayList<GeometryProviderExtension>();\r
private Map<Resource,GeometryProvider> providers;\r
\r
private GeometryProviderRegistry() {\r
- loader = new ExtensionLoader<GeometryProvider>(ELEMENT_NAME, NAME_SPACE, EP_NAME);\r
providers = new HashMap<Resource,GeometryProvider>();\r
+ \r
+ tracker = new ExtensionTracker();\r
+ \r
+ IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(NAMESPACE,EP_NAME);\r
+ loadExtensions(ep.getConfigurationElements());\r
+ \r
+ IFilter filter = ExtensionTracker.createExtensionPointFilter(ep);\r
+ tracker.registerHandler(this, filter);\r
}\r
\r
- public static GeometryProviderRegistry getInstance() {\r
+ private void close() {\r
+ tracker.close();\r
+ tracker = null;\r
+ extensions = new ArrayList<GeometryProviderExtension>();\r
+ }\r
+ \r
+ public static synchronized GeometryProviderRegistry getInstance() {\r
if (instance==null) instance = new GeometryProviderRegistry();\r
return instance;\r
}\r
-\r
- public Extension<GeometryProvider>[] getExtensions() {\r
- return loader.getExtensions();\r
- }\r
+ \r
+ public static synchronized void dispose() {\r
+ if (instance != null) {\r
+ instance.close();\r
+ instance = null;\r
+ } \r
+ }\r
+ \r
+ public synchronized List<GeometryProviderExtension> getExtensions() {\r
+ return Collections.unmodifiableList(extensions);\r
+ }\r
+ \r
+ private synchronized void loadExtensions(IConfigurationElement[] elements) {\r
+ for (IConfigurationElement el : elements) {\r
+ String id = el.getAttribute("id");\r
+ try {\r
+ Object o = el.createExecutableExtension("class");\r
+ GeometryProviderExtension ext = new GeometryProviderExtension(id,(GeometryProvider)o);\r
+ tracker.registerObject(el.getDeclaringExtension(), ext, IExtensionTracker.REF_STRONG);\r
+ extensions.add(ext);\r
+ } catch (CoreException e) {\r
+ ErrorLogger.defaultLogError("Cannot create java interface for GeometryProvider " + id, e);\r
+ }\r
+ }\r
+ }\r
\r
private Map<Resource,GeometryProvider> getProviderMap() {\r
return providers;\r
for (IEntity t : types) {\r
GeometryProvider provider = getInstance().getProviderMap().get(t.getResource());\r
if (provider == null) {\r
- for (Extension<GeometryProvider> e : getInstance().getExtensions()) {\r
- if (e.getInstance().canHandle(thing)) {\r
- getInstance().getProviderMap().put(t.getResource(), e.getInstance());\r
- return e.getInstance();\r
+ //for (Extension<GeometryProvider> e : getInstance().getExtensions()) {\r
+ for (GeometryProviderExtension e : getInstance().getExtensions()) {\r
+ if (e.provider.canHandle(thing)) {\r
+ getInstance().getProviderMap().put(t.getResource(), e.provider);\r
+ return e.provider;\r
}\r
}\r
\r
\r
throw new UnsupportedOperationException("Cannot handle resource " + thing);\r
}\r
+ \r
+ @Override\r
+ public void addExtension(IExtensionTracker tracker, IExtension extension) {\r
+ loadExtensions(extension.getConfigurationElements());\r
+ }\r
+ \r
+ @Override\r
+ public synchronized void removeExtension(IExtension extension, Object[] objects) {\r
+ for (Object o : objects) {\r
+ GeometryProviderExtension ext = (GeometryProviderExtension) o;\r
+ tracker.unregisterObject(extension, ext);\r
+ extensions.remove(ext);\r
+ }\r
+ }\r
+ \r
+ public class GeometryProviderExtension {\r
+ public String id;\r
+ public GeometryProvider provider;\r
+ \r
+ public GeometryProviderExtension(String id, GeometryProvider provider) {\r
+ this.id = id;\r
+ this.provider = provider;\r
+ }\r
+ }\r
}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
import java.nio.ByteBuffer;\r
import org.simantics.proconf.g3d.stubs.TextureCoordinateGenerator;\r
import org.simantics.proconf.image.interfaces.IImage;\r
import org.simantics.proconf.image.interfaces.IImageFactory;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.ui.gfx.ImageUtils;\r
import org.simantics.utils.ui.gfx.PixelDimension;\r
\r
import com.jme.image.Image;\r
import com.jme.image.Texture;\r
-import com.jme.util.TextureManager;\r
\r
/**\r
* Caches resource based textures.\r
* TODO : either use shared context or use separate cache for each editor\r
* TODO : ShapeNode implementation won't use release texture yet\r
* TODO : Texture is released when reference count goes to zero; we probably want to wait for a while before texture is released because it might be used again.\r
+ * TODO : Support for other types of textures (not just pattern texture, preferably extensible interface)\r
* \r
* @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>\r
*\r
ImageTexture it = new ImageTexture(g,res);\r
org.simantics.image.stubs.Image pattern = it.getImage();\r
Image image = loadImage(g, pattern.getResource());\r
-// image.getData().rewind();\r
-// while (image.getData().hasRemaining())\r
-// image.getData().put((byte)(Math.random()*256.0 - 127.0));\r
+\r
if (image == null) {\r
return null;\r
}\r
t = new Texture();\r
t.setImage(image);\r
\r
- //t = TextureManager.loadTexture(image, Texture.MM_LINEAR, Texture.FM_LINEAR);\r
-// t.setImageLocation(res.toString());\r
-// URL url = FileLocator.find(com.jme.eclipse.Activator.getDefault().getBundle(),new Path("data/texture/clouds.png"),null);\r
-// t = TextureManager.loadTexture(url, Texture.MM_LINEAR, Texture.FM_LINEAR);\r
\r
t.setFilter(com.jme.image.Texture.FM_LINEAR);\r
t.setMipmapState(com.jme.image.Texture.MM_LINEAR);\r
return instance;\r
}\r
\r
- private static Image getImage(ImageData imageData) {\r
+ public static Image getImage(ImageData imageData) {\r
int width = imageData.width;\r
int height = imageData.height;\r
int type = 0;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import java.util.List;\r
import java.util.Queue;\r
import java.util.Set;\r
-import java.util.Stack;\r
import java.util.concurrent.ConcurrentLinkedQueue;\r
\r
import org.simantics.db.AbstractQuery;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.scenegraph.RootGraphicsNode;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.datastructures.BijectionMap;\r
\r
import com.jme.scene.Node;\r
* @param root\r
* @return\r
*/\r
- protected abstract NodeTransformationQuery newTransformationListener(G3DNode root);\r
+ protected abstract NodeTransformationQuery newTransformationListener(G3DNode node);\r
\r
/**\r
* Returns propertyQuery for the root node.\r
*/\r
protected IGraphicsNode addNode(IEntity parent, IEntity r) {\r
if (!r.isInstanceOf(Resources.g3dResource.G3DNode)) {\r
- ErrorLogger.defaultLogError("Trying to add node into scenegraph that is not instance of graphicsnode " + r,new Exception("ASSERT!"));\r
+ ErrorLogger.defaultLogError("Trying to add node into scenegraph that is not instance of G3DNode " + r,new Exception("ASSERT!"));\r
return null;\r
}\r
if (parent.equals(r)) {\r
if (DEBUG) System.out.println("ThreeDimensionalEditorBase.addNodeP(" + r.getResource().getResourceId() + ") already in view");\r
return inView;\r
} else {\r
- if (DEBUG) System.out.println("ThreeDimensionalEditorBase.addNodeP(" + r.getResource().getResourceId() + ") already in view, but has different parent, current parent is ("+inView.getParent().getResource()+") and node is added to ("+parent+") -> removing from old parent and inserting to new");\r
+ if (DEBUG) System.out.println("ThreeDimensionalEditorBase.addNodeP(" + r.getResource().getResourceId() + ") already in view, but has different parent, current parent is ("+inView.getParent().getResource().getResourceId()+") and node is added to ("+parent+") -> removing from old parent and inserting to new");\r
removeNode(inView.getParent().getResource(),r.getResource());\r
}\r
}\r
public abstract class NodeQuery extends AbstractQuery<Object>{\r
protected Resource nodeResource;\r
private boolean disposed = false;\r
- private IQueryListener listener;\r
- //private OverridingTransactionRunner runner;\r
\r
+ private IQueryListener listener = null;\r
\r
public NodeQuery(Resource r) {\r
this.nodeResource = r;\r
- //runner = new OverridingTransactionRunner(session,true);\r
- \r
}\r
\r
protected abstract Object compute2(Graph graph);\r
if (disposed)\r
throw new RuntimeException("Updating disposed query"); //return;\r
transactionRunner.run(new GraphRequestAdapter() {\r
- //session.asyncWrite(new GraphRequestAdapter() {\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
if (!disposed) {\r
if (DEBUG) System.out.println("NodeQuery " + nodeResource + " disposed()" + " " + this.getClass());\r
}\r
\r
- //public abstract NodeQuery instantiateQuery(Resource node);\r
- //public abstract void attach();\r
- \r
@Override\r
public boolean isDisposed() {\r
return disposed;\r
}\r
\r
+ // without separate listener, this query would work only once\r
@Override\r
public IQueryListener getListener() {\r
if (listener == null) {\r
}\r
return listener;\r
}\r
- \r
}\r
\r
/**\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
private Gizmo currentGizmo = null;\r
\r
public SelectionAdapter(ScenegraphAdapter adapter) {\r
+ if (adapter == null)\r
+ throw new NullPointerException("Scenegraph adapter must no be null");\r
this.adapter = adapter;\r
}\r
\r
* @param s\r
* @return the filtered selection\r
*/\r
- protected abstract StructuredResourceSelection filterSelection(ISelection s);\r
+ protected StructuredResourceSelection filterSelection(ISelection s) {\r
+ if (!(selection instanceof StructuredResourceSelection))\r
+ return new StructuredResourceSelection();\r
+ return (StructuredResourceSelection) selection;\r
+ }\r
\r
/**\r
* Updates visual part of selection event. Use getCurrentSelection() to get\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
\r
import java.awt.event.MouseEvent;\r
import java.util.ArrayList;\r
-import java.util.HashMap;\r
import java.util.List;\r
-import java.util.Map;\r
-import java.util.Stack;\r
\r
import javax.vecmath.Tuple3d;\r
import javax.vecmath.Vector3d;\r
\r
import org.eclipse.jface.action.Action;\r
-import org.eclipse.jface.action.IContributionItem;\r
import org.eclipse.jface.action.IMenuListener;\r
import org.eclipse.jface.action.IMenuManager;\r
import org.eclipse.jface.action.IToolBarManager;\r
import org.eclipse.swt.widgets.Composite;\r
import org.eclipse.swt.widgets.Menu;\r
import org.eclipse.ui.IActionBars;\r
-import org.eclipse.ui.IEditorActionBarContributor;\r
import org.eclipse.ui.ISharedImages;\r
import org.eclipse.ui.IWorkbenchActionConstants;\r
import org.eclipse.ui.IWorkbenchPart;\r
import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.commands.ICommandService;\r
import org.eclipse.ui.internal.WorkbenchWindow;\r
import org.simantics.db.Graph;\r
import org.simantics.db.GraphRequestAdapter;\r
import org.simantics.proconf.g3d.scenegraph.IGeometryNode;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.tools.ScenegraphLockTraverser;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.ui.jface.MenuTools;\r
\r
import com.jme.math.Ray;\r
this.component = component;\r
}\r
\r
+ protected void setRenderingComponent(JmeRenderingComponent component) {\r
+ assert(renderingComposite == null); // ensure that this is called before initialization\r
+ this.component = component;\r
+ }\r
+ \r
// public void setActionBarContributor(IEditorActionBarContributor contributor) {\r
// actionBarContributor = contributor;\r
// }\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.eclipse.swt.widgets.Composite;\r
import org.eclipse.swt.widgets.Display;\r
import org.eclipse.ui.IActionBars;\r
-import org.eclipse.ui.IPartListener;\r
import org.eclipse.ui.ISelectionListener;\r
import org.eclipse.ui.IWorkbenchPart;\r
import org.simantics.db.Graph;\r
import org.simantics.db.events.GraphChangeEvent;\r
import org.simantics.db.management.ISessionContext;\r
import org.simantics.proconf.ui.workbench.ResourceEditorPart;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
\r
public abstract class ThreeDimensionalEditorPart extends ResourceEditorPart implements ThreeDimensionalEditorProvider{\r
editor = createEditor(getSessionContext());\r
\r
// add partlistener that loads the scene-graph when the view has been created\r
- this.getEditorSite().getPage().addPartListener(new IPartListener() {\r
- \r
- boolean opened = false;\r
- boolean activated = false;\r
- \r
- public void partOpened(IWorkbenchPart part) {\r
- if (part.equals(ThreeDimensionalEditorPart.this.getEditorSite().getPart())) {\r
- opened = true;\r
- }\r
- }\r
- \r
- public void partActivated(IWorkbenchPart part) {\r
- if (part.equals(ThreeDimensionalEditorPart.this.getEditorSite().getPart())) {\r
- if (opened & !activated) {\r
- activated = true;\r
- load();\r
- }\r
- }\r
+ this.getEditorSite().getPage().addPartListener(new EditorLoader() {\r
+\r
+ public IWorkbenchPart getWorkbechPart() {\r
+ return ThreeDimensionalEditorPart.this.getEditorSite().getPart();\r
}\r
\r
- public void partBroughtToTop(IWorkbenchPart part) {}\r
- \r
- public void partClosed(IWorkbenchPart part) {}\r
- \r
- public void partDeactivated(IWorkbenchPart part) {}\r
- \r
- private void load() {\r
+ public void load() {\r
//System.out.println("ThreeDimensionalEditorPart.reload()");\r
Session ses = ThreeDimensionalEditorPart.this.getSession();\r
GraphRequestAdapter r = new GraphRequestAdapter() {\r
private void hookPageSelection() {\r
pageSelectionListener = new ISelectionListener() {\r
public void selectionChanged(IWorkbenchPart part, ISelection selection) {\r
- if (part == ThreeDimensionalEditorPart.this)\r
- return;\r
+ if (part == ThreeDimensionalEditorPart.this) {\r
+ return;\r
+ }\r
pageSelectionChanged(part, selection);\r
}\r
};\r
getSite().getPage().addPostSelectionListener(pageSelectionListener);\r
+ getSite().getPage().addSelectionListener(pageSelectionListener);\r
ISelection sel = getSite().getPage().getSelection();\r
IWorkbenchPart wb = getSite().getPage().getActivePart();\r
pageSelectionChanged(wb, sel);\r
}\r
\r
public void dispose() {\r
- if (pageSelectionListener != null)\r
+ if (pageSelectionListener != null) {\r
getSite().getPage().removePostSelectionListener(pageSelectionListener);\r
+ getSite().getPage().removeSelectionListener(pageSelectionListener);\r
+ }\r
editor.dispose();\r
super.dispose();\r
}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.base;\r
\r
import java.util.Collection;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
\r
import org.eclipse.swt.widgets.Display;\r
import org.eclipse.ui.PlatformUI;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
\r
/**\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.events.ControlAdapter;\r
import org.eclipse.swt.events.ControlEvent;\r
+import org.eclipse.swt.events.PaintEvent;\r
+import org.eclipse.swt.events.PaintListener;\r
import org.eclipse.swt.graphics.Rectangle;\r
import org.eclipse.swt.layout.FillLayout;\r
import org.eclipse.swt.opengl.GLCanvas;\r
import org.eclipse.swt.widgets.Composite;\r
import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
import org.simantics.proconf.g3d.base.ResourceTextureCache;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.renderer.Renderer;\r
import com.jme.renderer.lwjgl.LWJGLRenderer;\r
}\r
});\r
\r
+// this.addPaintListener(new PaintListener() {\r
+// @Override\r
+// public void paintControl(PaintEvent e) {\r
+// displaySystem.setCurrent();\r
+// JmeComposite.this.component.render();\r
+// }\r
+// });\r
+ \r
\r
}\r
\r
public DisplaySystem getDisplaySystem() {\r
return displaySystem;\r
}\r
+ \r
+ \r
}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
private boolean showNormals = false;\r
private WireframeState ws = null;\r
\r
- private boolean projectionUpdated = false;\r
+ protected boolean projectionUpdated = false;\r
\r
public JmeSinglePassRenderingComponent() {\r
\r
}\r
}\r
\r
- private void updateProjection() {\r
+ protected void updateProjection() {\r
switch (projectionPolicy) {\r
case PERSPECTIVE_PROJECTION:\r
cam.setParallelProjection(false);\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.common;\r
\r
import org.eclipse.core.expressions.PropertyTester;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
public class ModelNode extends AbstractGraphicsNode implements Animatable, IGeometryNode{\r
protected List<ShapeNode> shapes = new ArrayList<ShapeNode>();\r
G3DModel model = getG3DModel(graph);\r
Collection<G3DNode> nodes = model.getChild();\r
if (nodes.size() == 0) {\r
- ErrorLogger.defaultLogError("ModelNode " + model.getResource() + " has no shapes", null);\r
+ ErrorLogger.defaultLogError("ModelNode " + model.getResource().getResourceId() + " has no shapes", null);\r
return;\r
}\r
for (G3DNode node: nodes) {\r
return false; \r
}\r
G3DModel model = getG3DModel(graph);\r
- Collection<org.simantics.g2d.stubs.anim.Animation> animations = model.getAnimation();\r
+ Collection<org.simantics.animation.stubs.Animation> animations = model.getAnimation();\r
int num = animations.size();\r
if (num == 0) {\r
ErrorLogger.getDefault().logWarning("Cannot set animation for " + shapeResource + " since it has no animations", null);\r
return false; \r
}\r
int random = (int)Math.round(Math.random() * (num-1));\r
- Iterator<org.simantics.g2d.stubs.anim.Animation> i = animations.iterator();\r
+ Iterator<org.simantics.animation.stubs.Animation> i = animations.iterator();\r
while(random > 0) {\r
i.next();\r
random--;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
import org.simantics.equation.solver.Solver;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
+import org.simantics.animation.stubs.Animation;\r
import org.simantics.layer0.utils.Property;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
/**\r
* IGraphicsNode for parameterized models. Implementation assumes that G3DNode itself does not contain\r
solver.pushToGraph(graph);\r
Collection<Animation> animations = model.getAnimation();\r
for (Animation animation : animations) {\r
- Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
- for (org.simantics.g2d.stubs.anim.Interpolator interpolator : interpolators) {\r
+ Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+ for (org.simantics.animation.stubs.Interpolator interpolator : interpolators) {\r
IEntity target = interpolator.getTarget();\r
// check all model properties\r
for (Property p : modelProperties) {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import javax.vecmath.AxisAngle4d;\r
import javax.vecmath.Quat4d;\r
\r
-import org.simantics.g2d.stubs.anim.Interpolator;\r
+import org.simantics.animation.stubs.Interpolator;\r
import org.simantics.animation.curve.SlerpCurve;\r
import org.simantics.animation.curve.TCBCurve;\r
import org.simantics.proconf.g3d.Resources;\r
import org.simantics.proconf.g3d.animation.ScalarInterpolator;\r
import org.simantics.proconf.g3d.animation.SlerpInterpolator;\r
import org.simantics.proconf.g3d.animation.TCBInterpolator;\r
+import org.simantics.proconf.g3d.base.AppearanceProvider;\r
+import org.simantics.proconf.g3d.base.AppearanceProviderRegistry;\r
import org.simantics.proconf.g3d.base.AppearanceTools;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.GeometryProvider;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
import org.simantics.proconf.g3d.stubs.Orientation;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.bounding.BoundingBox;\r
import com.jme.bounding.CollisionTreeManager;\r
\r
\r
G3DNode shape = getG3DNode(graph);\r
- if (renderStates == null)\r
+ //if (renderStates == null)\r
updateAppearance(shape);\r
\r
if (isVisible()) {\r
}\r
\r
protected void updateAppearance(IEntity shape) {\r
- Collection<IEntity> appearanceResource;\r
- if ((appearanceResource = shape.getRelatedObjects(Resources.g3dResource.HasAppearance)) != null && appearanceResource.size() > 0) {\r
- renderStates = AppearanceTools.getAppearance(new Appearance(shape.getGraph(),appearanceResource.iterator().next().getResource()), editor.getRenderingComponent().getDisplaySystem().getRenderer());\r
+ AppearanceProvider provider = AppearanceProviderRegistry.getAppearanceProvider(shape);\r
+ if (provider != null) {\r
+ renderStates = provider.getAppearanceFromResource(shape, editor.getRenderingComponent().getDisplaySystem().getRenderer());\r
} else {\r
renderStates = getMaterial();\r
}\r
body.attachChild(mesh);\r
return false;\r
}\r
- org.simantics.g2d.stubs.anim.Animation animation = new org.simantics.g2d.stubs.anim.Animation(graph,res);\r
+ org.simantics.animation.stubs.Animation animation = new org.simantics.animation.stubs.Animation(graph,res);\r
G3DNode shape = getG3DNode(graph);\r
G3DNode modelResource = G3DTools.getModelFromResource(graph,shape.getResource());\r
assert (modelResource != null);\r
G3DModel model = new G3DModel(graph,modelResource.getResource());\r
- Collection<org.simantics.g2d.stubs.anim.Animation> animations = model.getAnimation();\r
+ Collection<org.simantics.animation.stubs.Animation> animations = model.getAnimation();\r
boolean found = false;\r
- for (org.simantics.g2d.stubs.anim.Animation a : animations) {\r
+ for (org.simantics.animation.stubs.Animation a : animations) {\r
if (a.getResource().equals(animation.getResource())) {\r
found = true;\r
break;\r
ErrorLogger.getDefault().logWarning("Shape " + shape.getResource() + " cannot handle animation " + animation.getResource() + " because it isn't model's animation", null);\r
return false;\r
}\r
- Collection<org.simantics.g2d.stubs.anim.Interpolator> interpolators = animation.getInterpolator();\r
- List<org.simantics.g2d.stubs.anim.Interpolator> handled = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
- List<org.simantics.g2d.stubs.anim.Interpolator> precalculated = new ArrayList<org.simantics.g2d.stubs.anim.Interpolator>();\r
- for (org.simantics.g2d.stubs.anim.Interpolator i : interpolators) {\r
+ Collection<org.simantics.animation.stubs.Interpolator> interpolators = animation.getInterpolator();\r
+ List<org.simantics.animation.stubs.Interpolator> handled = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+ List<org.simantics.animation.stubs.Interpolator> precalculated = new ArrayList<org.simantics.animation.stubs.Interpolator>();\r
+ for (org.simantics.animation.stubs.Interpolator i : interpolators) {\r
IEntity target = i.getTarget();\r
if (G3DTools.hasProperty(graph,shape.getResource(),target.getResource()))\r
handled.add(i);\r
\r
this.animation = new Animation();\r
\r
- org.simantics.g2d.stubs.anim.Interpolator[] pos = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] ambient = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] diffuse = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] specular = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
- org.simantics.g2d.stubs.anim.Interpolator[] emissive = new org.simantics.g2d.stubs.anim.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] pos = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] ambient = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] diffuse = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] specular = new org.simantics.animation.stubs.Interpolator[3];\r
+ org.simantics.animation.stubs.Interpolator[] emissive = new org.simantics.animation.stubs.Interpolator[3];\r
\r
Builtins builtins = graph.getBuiltins();\r
\r
\r
- for (org.simantics.g2d.stubs.anim.Interpolator i : handled) {\r
+ for (org.simantics.animation.stubs.Interpolator i : handled) {\r
IEntity target = i.getTarget();\r
//if (target.isInstanceOf(Resources.g3dResource.LocalOrientation)) {\r
if (target.isInstanceOf(Resources.g3dResource.Orientation) && target.getRelatedObjects(Resources.g3dResource.LocalOrientationOf).size() == 1) {\r
ErrorLogger.getDefault().logWarning("Cannot map animation interpolator " + i.getResource() + " to target (Position ?)" + target.getResource(), null);\r
}\r
} else if (parent.isInstanceOf(Resources.g3dResource.Color)) {\r
- org.simantics.g2d.stubs.anim.Interpolator[] color = null;\r
+ org.simantics.animation.stubs.Interpolator[] color = null;\r
if (parent.isInstanceOf(Resources.g3dResource.Color) && parent.getRelatedObjects(Resources.g3dResource.AmbientColorOf).size() > 0) {\r
color = ambient;\r
} else if (parent.isInstanceOf(Resources.g3dResource.Color)&& parent.getRelatedObjects(Resources.g3dResource.DiffuseColorOf).size() > 0) {\r
return true;\r
}\r
\r
- private void addColorInterpolator(G3DNode shape, org.simantics.g2d.stubs.anim.Interpolator[] color, int type) {\r
+ private void addColorInterpolator(G3DNode shape, org.simantics.animation.stubs.Interpolator[] color, int type) {\r
if (color[0] != null || color[1] != null || color[2] != null) {\r
ScalarInterpolator xIp;\r
ScalarInterpolator yIp;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.tools;\r
\r
import java.util.ArrayList;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.proconf.image.interfaces.IImageFactory;\r
import org.simantics.proconf.image.ui.ImageComposite;\r
import org.simantics.proconf.ui.utils.ResourceAdaptionUtils;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
\r
public class AppearanceEditor extends SinglePageResourceView{\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
import org.simantics.db.Session;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
import org.simantics.proconf.ui.workbench.ResourceEditorPart;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.ui.ISelectionUtils;\r
import org.simantics.utils.ui.jface.BaseSelectionProvider;\r
\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.proconf.g3d.views;\r
\r
import org.eclipse.jface.viewers.ISelection;\r
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Processeditor Plug-in
-Bundle-SymbolicName: fi.vtt.simantics.processeditor;singleton:=true
+Bundle-SymbolicName: org.simantics.processeditor;singleton:=true
Bundle-Version: 1.0.0
-Bundle-Activator: fi.vtt.simantics.processeditor.Activator
+Bundle-Activator: org.simantics.processeditor.Activator
Bundle-Vendor: VTT
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.jme.eclipse,
- org.simantics.g2d.stubs,
org.simantics.proconf.ui,
org.simantics.proconf.g3d,
org.simantics.proconf.image,
org.simantics.utils.ui,
org.simantics.utils.ui.workbench,
org.simantics.proconf.g3d.shapeeditor,
- org.eclipse.ui.views
+ org.eclipse.ui.views,
+ org.simantics.animation
Eclipse-LazyStart: true
+Export-Package: org.simantics.processeditor.adapters,
+ org.simantics.processeditor.common,
+ org.simantics.processeditor.stubs,
+ org.simantics.processeditor.tools
+++ /dev/null
-# Blender v242 OBJ File: dcp.blend\r
-# www.blender3d.org\r
-mtllib dcp.mtl\r
-o Sphere_Sphere\r
-v 0.092388 -0.000000 -0.038268\r
-v -0.092388 0.014645 -0.035355\r
-v -0.070711 0.027060 -0.065328\r
-v -0.038268 0.035355 -0.085355\r
-v 0.000000 0.038268 -0.092388\r
-v 0.038268 0.035355 -0.085355\r
-v 0.070711 0.027060 -0.065328\r
-v 0.092388 0.014645 -0.035355\r
-v 0.092388 0.027060 -0.027060\r
-v 0.070711 0.050000 -0.050000\r
-v 0.038268 0.065328 -0.065328\r
-v 0.000000 0.070711 -0.070711\r
-v -0.038268 0.065328 -0.065328\r
-v -0.070711 0.050000 -0.050000\r
-v -0.092388 0.027060 -0.027060\r
-v -0.092388 0.035355 -0.014645\r
-v -0.070711 0.065328 -0.027060\r
-v -0.038268 0.085355 -0.035355\r
-v 0.000000 0.092388 -0.038268\r
-v 0.038268 0.085355 -0.035355\r
-v 0.070711 0.065328 -0.027060\r
-v 0.092388 0.035355 -0.014645\r
-v 0.092388 0.038268 0.000000\r
-v 0.070711 0.070711 0.000000\r
-v 0.038268 0.092388 0.000000\r
-v 0.000000 0.100000 0.000000\r
-v -0.038268 0.092388 -0.000000\r
-v -0.070711 0.070711 -0.000000\r
-v -0.092388 0.038268 -0.000000\r
-v -0.092388 0.035355 0.014645\r
-v -0.070711 0.065328 0.027060\r
-v -0.038268 0.085355 0.035355\r
-v 0.000000 0.092388 0.038268\r
-v 0.038268 0.085355 0.035355\r
-v 0.070711 0.065328 0.027060\r
-v 0.092388 0.035355 0.014645\r
-v 0.092388 0.027060 0.027060\r
-v 0.070711 0.050000 0.050000\r
-v 0.038268 0.065328 0.065328\r
-v 0.000000 0.070711 0.070711\r
-v -0.038268 0.065328 0.065328\r
-v -0.070711 0.050000 0.050000\r
-v -0.092388 0.027060 0.027060\r
-v -0.092388 0.014645 0.035355\r
-v -0.070711 0.027060 0.065328\r
-v -0.038268 0.035355 0.085355\r
-v -0.000000 0.038268 0.092388\r
-v 0.038268 0.035355 0.085355\r
-v 0.070711 0.027060 0.065328\r
-v 0.092388 0.014645 0.035355\r
-v 0.092388 -0.000000 0.038268\r
-v 0.070711 -0.000000 0.070711\r
-v 0.038268 -0.000000 0.092388\r
-v -0.000000 0.000000 0.100000\r
-v -0.038268 -0.000000 0.092388\r
-v -0.070711 -0.000000 0.070711\r
-v -0.092388 0.000000 0.038268\r
-v -0.092388 -0.014645 0.035355\r
-v -0.070711 -0.027060 0.065328\r
-v -0.038268 -0.035355 0.085355\r
-v -0.000000 -0.038268 0.092388\r
-v 0.038268 -0.035355 0.085355\r
-v 0.070711 -0.027060 0.065328\r
-v 0.092388 -0.014645 0.035355\r
-v 0.092388 -0.027060 0.027060\r
-v 0.070711 -0.050000 0.050000\r
-v 0.038268 -0.065328 0.065328\r
-v -0.000000 -0.070711 0.070711\r
-v -0.038268 -0.065328 0.065328\r
-v -0.070711 -0.050000 0.050000\r
-v -0.092388 -0.027060 0.027060\r
-v -0.100000 -0.000000 0.000000\r
-v -0.092388 -0.035355 0.014645\r
-v -0.070711 -0.065328 0.027060\r
-v -0.038268 -0.085355 0.035355\r
-v -0.000000 -0.092388 0.038268\r
-v 0.038268 -0.085355 0.035355\r
-v 0.070711 -0.065328 0.027060\r
-v 0.092388 -0.035355 0.014645\r
-v 0.092388 -0.038268 0.000000\r
-v 0.070711 -0.070711 0.000000\r
-v 0.038268 -0.092388 0.000000\r
-v 0.000000 -0.100000 0.000000\r
-v -0.038268 -0.092388 -0.000000\r
-v -0.070711 -0.070711 -0.000000\r
-v -0.092388 -0.038268 -0.000000\r
-v -0.092388 -0.035355 -0.014645\r
-v -0.070711 -0.065328 -0.027060\r
-v -0.038268 -0.085355 -0.035355\r
-v 0.000000 -0.092388 -0.038268\r
-v 0.038268 -0.085355 -0.035355\r
-v 0.070711 -0.065328 -0.027060\r
-v 0.092388 -0.035355 -0.014645\r
-v 0.092388 -0.027060 -0.027060\r
-v 0.070711 -0.050000 -0.050000\r
-v 0.038268 -0.065328 -0.065328\r
-v 0.000000 -0.070711 -0.070711\r
-v -0.038268 -0.065328 -0.065328\r
-v -0.070711 -0.050000 -0.050000\r
-v -0.092388 -0.027060 -0.027060\r
-v -0.092388 -0.014645 -0.035355\r
-v -0.070711 -0.027060 -0.065328\r
-v -0.038268 -0.035355 -0.085355\r
-v 0.000000 -0.038268 -0.092388\r
-v 0.038268 -0.035355 -0.085355\r
-v 0.070711 -0.027060 -0.065328\r
-v 0.092388 -0.014645 -0.035355\r
-v 0.070711 0.000000 -0.070711\r
-v 0.038268 0.000000 -0.092388\r
-v 0.000000 0.000000 -0.100000\r
-v -0.038268 0.000000 -0.092388\r
-v -0.070711 0.000000 -0.070711\r
-v -0.092388 0.000000 -0.038268\r
-v 0.232388 -0.014645 -0.035355\r
-v 0.232388 -0.027060 -0.027060\r
-v 0.232388 -0.035355 -0.014645\r
-v 0.232388 -0.038268 0.000000\r
-v 0.232388 -0.035355 0.014645\r
-v 0.232388 -0.027060 0.027060\r
-v 0.232388 -0.014645 0.035355\r
-v 0.232388 -0.000000 0.038268\r
-v 0.232388 0.014645 0.035355\r
-v 0.232388 0.027060 0.027060\r
-v 0.232388 0.035355 0.014645\r
-v 0.232388 0.038268 0.000000\r
-v 0.232388 0.035355 -0.014645\r
-v 0.232388 0.027060 -0.027060\r
-v 0.232388 0.014645 -0.035355\r
-v 0.232388 -0.000000 -0.038268\r
-v 0.231045 -0.000000 -0.153073\r
-v 0.231045 0.058579 -0.141421\r
-v 0.511493 -0.000000 0.000000\r
-v 0.231045 0.108239 -0.108239\r
-v 0.231045 0.141421 -0.058579\r
-v 0.231045 0.153073 0.000000\r
-v 0.231045 0.141421 0.058579\r
-v 0.231045 0.108239 0.108239\r
-v 0.231045 0.058579 0.141421\r
-v 0.231045 -0.000000 0.153073\r
-v 0.231045 -0.058579 0.141421\r
-v 0.231045 -0.108239 0.108239\r
-v 0.231045 -0.141421 0.058579\r
-v 0.231045 -0.153073 0.000000\r
-v 0.231045 -0.141421 -0.058579\r
-v 0.231045 -0.108239 -0.108239\r
-v 0.231045 -0.058579 -0.141421\r
-vn -0.999929 -0.002325 0.011699\r
-vn -0.999929 -0.006629 0.009917\r
-vn -0.999929 -0.009918 0.006627\r
-vn -0.999929 -0.011699 0.002327\r
-vn -0.999929 -0.011699 -0.002327\r
-vn -0.999929 -0.009918 -0.006627\r
-vn -0.999929 -0.006627 -0.009918\r
-vn -0.999929 -0.002327 -0.011699\r
-vn -0.999929 0.002327 -0.011699\r
-vn -0.999929 0.006627 -0.009918\r
-vn -0.999929 0.009918 -0.006627\r
-vn -0.999929 0.011699 -0.002327\r
-vn -0.999929 0.011699 0.002327\r
-vn -0.999929 0.009918 0.006627\r
-vn -0.999929 0.006627 0.009918\r
-vn -0.999929 0.002327 0.011699\r
-vn -1.000000 0.000000 0.000000\r
-vn -0.924070 0.146245 -0.353099\r
-vn -0.924070 0.000000 -0.382183\r
-vn -0.707602 0.270394 -0.652791\r
-vn -0.707602 0.000000 -0.706565\r
-vn -0.383129 0.353465 -0.853359\r
-vn -0.383129 0.000000 -0.923673\r
-vn 0.000000 0.382672 -0.923856\r
-vn 0.000000 0.000000 -1.000000\r
-vn 0.383129 0.353465 -0.853359\r
-vn 0.383129 0.000000 -0.923673\r
-vn 0.707602 0.270394 -0.652791\r
-vn 0.707602 0.000000 -0.706565\r
-vn 0.474532 0.336833 -0.813227\r
-vn 0.474532 0.000000 -0.880215\r
-vn 0.707602 0.499619 -0.499619\r
-vn 0.474532 0.622395 -0.622395\r
-vn 0.383129 0.653127 -0.653127\r
-vn 0.000000 0.707083 -0.707083\r
-vn -0.383129 0.653127 -0.653127\r
-vn -0.707602 0.499619 -0.499619\r
-vn -0.924070 0.270241 -0.270241\r
-vn -0.924070 0.353099 -0.146245\r
-vn -0.707602 0.652791 -0.270394\r
-vn -0.383129 0.853359 -0.353465\r
-vn 0.000000 0.923856 -0.382672\r
-vn 0.383129 0.853359 -0.353465\r
-vn 0.707602 0.652791 -0.270394\r
-vn 0.474532 0.813227 -0.336833\r
-vn 0.707602 0.706565 0.000000\r
-vn 0.474532 0.880215 0.000000\r
-vn 0.383129 0.923673 0.000000\r
-vn 0.000000 1.000000 0.000000\r
-vn -0.383129 0.923673 0.000000\r
-vn -0.707602 0.706565 0.000000\r
-vn -0.924070 0.382183 0.000000\r
-vn -0.924070 0.353099 0.146245\r
-vn -0.707602 0.652791 0.270394\r
-vn -0.383129 0.853359 0.353465\r
-vn 0.000000 0.923856 0.382672\r
-vn 0.383129 0.853359 0.353465\r
-vn 0.707602 0.652791 0.270394\r
-vn 0.474532 0.813227 0.336833\r
-vn 0.707602 0.499619 0.499619\r
-vn 0.474532 0.622395 0.622395\r
-vn 0.383129 0.653127 0.653127\r
-vn 0.000000 0.707083 0.707083\r
-vn -0.383129 0.653127 0.653127\r
-vn -0.707602 0.499619 0.499619\r
-vn -0.924070 0.270241 0.270241\r
-vn -0.924070 0.146245 0.353099\r
-vn -0.707602 0.270394 0.652791\r
-vn -0.383129 0.353465 0.853359\r
-vn 0.000000 0.382672 0.923856\r
-vn 0.383129 0.353465 0.853359\r
-vn 0.707602 0.270394 0.652791\r
-vn 0.474532 0.336833 0.813227\r
-vn 0.707602 0.000000 0.706565\r
-vn 0.474532 0.000000 0.880215\r
-vn 0.383129 0.000000 0.923673\r
-vn 0.000000 0.000000 1.000000\r
-vn -0.383129 0.000000 0.923673\r
-vn -0.707602 0.000000 0.706565\r
-vn -0.924070 0.000000 0.382183\r
-vn -0.924070 -0.146245 0.353099\r
-vn -0.707602 -0.270394 0.652791\r
-vn -0.383129 -0.353465 0.853359\r
-vn 0.000000 -0.382672 0.923856\r
-vn 0.383129 -0.353465 0.853359\r
-vn 0.707602 -0.270394 0.652791\r
-vn 0.474532 -0.336833 0.813227\r
-vn 0.707602 -0.499619 0.499619\r
-vn 0.474532 -0.622395 0.622395\r
-vn 0.383129 -0.653127 0.653127\r
-vn 0.000000 -0.707083 0.707083\r
-vn -0.383129 -0.653127 0.653127\r
-vn -0.707602 -0.499619 0.499619\r
-vn -0.924070 -0.270241 0.270241\r
-vn -0.924070 -0.353099 0.146245\r
-vn -0.707602 -0.652791 0.270394\r
-vn -0.383129 -0.853359 0.353465\r
-vn 0.000000 -0.923856 0.382672\r
-vn 0.383129 -0.853359 0.353465\r
-vn 0.707602 -0.652791 0.270394\r
-vn 0.474532 -0.813227 0.336833\r
-vn 0.707602 -0.706565 0.000000\r
-vn 0.474532 -0.880215 0.000000\r
-vn 0.383129 -0.923673 0.000000\r
-vn 0.000000 -1.000000 0.000000\r
-vn -0.383129 -0.923673 0.000000\r
-vn -0.707602 -0.706565 0.000000\r
-vn -0.924070 -0.382183 0.000000\r
-vn -0.924070 -0.353099 -0.146245\r
-vn -0.707602 -0.652791 -0.270394\r
-vn -0.383129 -0.853359 -0.353465\r
-vn 0.000000 -0.923856 -0.382672\r
-vn 0.383129 -0.853359 -0.353465\r
-vn 0.707602 -0.652791 -0.270394\r
-vn 0.474532 -0.813227 -0.336833\r
-vn 0.707602 -0.499619 -0.499619\r
-vn 0.474532 -0.622395 -0.622395\r
-vn 0.383129 -0.653127 -0.653127\r
-vn 0.000000 -0.707083 -0.707083\r
-vn -0.383129 -0.653127 -0.653127\r
-vn -0.707602 -0.499619 -0.499619\r
-vn -0.924070 -0.270241 -0.270241\r
-vn -0.924070 -0.146245 -0.353099\r
-vn -0.707602 -0.270394 -0.652791\r
-vn -0.383129 -0.353465 -0.853359\r
-vn 0.000000 -0.382672 -0.923856\r
-vn 0.383129 -0.353465 -0.853359\r
-vn 0.707602 -0.270394 -0.652791\r
-vn 0.474532 -0.336833 -0.813227\r
-vn -0.718070 0.000000 -0.695944\r
-vn -0.718070 -0.266305 -0.642964\r
-vn -0.718070 -0.492080 -0.492080\r
-vn -0.718070 -0.642964 -0.266305\r
-vn -0.718070 -0.695944 0.000000\r
-vn -0.718070 -0.642964 0.266305\r
-vn -0.718070 -0.492080 0.492080\r
-vn -0.718070 -0.266305 0.642964\r
-vn -0.718070 0.000000 0.695944\r
-vn -0.718070 0.266305 0.642964\r
-vn -0.718070 0.492080 0.492080\r
-vn -0.718070 0.642964 0.266305\r
-vn -0.718070 0.695944 0.000000\r
-vn -0.718070 0.642964 -0.266305\r
-vn -0.718070 0.492080 -0.492080\r
-vn -0.718070 0.266305 -0.642964\r
-vn -0.526292 0.000000 -0.850276\r
-vn -0.526292 0.325388 -0.785546\r
-vn 1.000000 0.000000 0.000000\r
-vn -0.526292 0.601245 -0.601245\r
-vn -0.526292 0.785546 -0.325388\r
-vn -0.526292 0.850276 0.000000\r
-vn -0.526292 0.785546 0.325388\r
-vn -0.526292 0.601245 0.601245\r
-vn -0.526292 0.325388 0.785546\r
-vn -0.526292 0.000000 0.850276\r
-vn -0.526292 -0.325388 0.785546\r
-vn -0.526292 -0.601245 0.601245\r
-vn -0.526292 -0.785546 0.325388\r
-vn -0.526292 -0.850276 0.000000\r
-vn -0.526292 -0.785546 -0.325388\r
-vn -0.526292 -0.601245 -0.601245\r
-vn -0.526292 -0.325388 -0.785546\r
-usemtl (null)\r
-usemtl (null)\r
-s off\r
-f 129//1 128//1 131//1 130//1\r
-f 128//2 127//2 133//2 131//2\r
-f 127//3 126//3 134//3 133//3\r
-f 126//4 125//4 135//4 134//4\r
-f 125//5 124//5 136//5 135//5\r
-f 124//6 123//6 137//6 136//6\r
-f 123//7 122//7 138//7 137//7\r
-f 122//8 121//8 139//8 138//8\r
-f 121//9 120//9 140//9 139//9\r
-f 120//10 119//10 141//10 140//10\r
-f 119//11 118//11 142//11 141//11\r
-f 118//12 117//12 143//12 142//12\r
-f 117//13 116//13 144//13 143//13\r
-f 116//14 115//14 145//14 144//14\r
-f 115//15 114//15 146//15 145//15\r
-f 114//16 129//16 130//16 146//16\r
-s 1\r
-f 72//17 2//18 113//19\r
-f 113//19 2//18 3//20 112//21\r
-f 112//21 3//20 4//22 111//23\r
-f 111//23 4//22 5//24 110//25\r
-f 110//25 5//24 6//26 109//27\r
-f 109//27 6//26 7//28 108//29\r
-f 8//30 1//31 108//29 7//28\r
-f 7//28 10//32 9//33 8//30\r
-f 6//26 11//34 10//32 7//28\r
-f 5//24 12//35 11//34 6//26\r
-f 4//22 13//36 12//35 5//24\r
-f 3//20 14//37 13//36 4//22\r
-f 2//18 15//38 14//37 3//20\r
-f 72//17 15//38 2//18\r
-f 72//17 16//39 15//38\r
-f 15//38 16//39 17//40 14//37\r
-f 14//37 17//40 18//41 13//36\r
-f 13//36 18//41 19//42 12//35\r
-f 12//35 19//42 20//43 11//34\r
-f 11//34 20//43 21//44 10//32\r
-f 10//32 21//44 22//45 9//33\r
-f 21//44 24//46 23//47 22//45\r
-f 20//43 25//48 24//46 21//44\r
-f 19//42 26//49 25//48 20//43\r
-f 18//41 27//50 26//49 19//42\r
-f 17//40 28//51 27//50 18//41\r
-f 16//39 29//52 28//51 17//40\r
-f 72//17 29//52 16//39\r
-f 72//17 30//53 29//52\r
-f 29//52 30//53 31//54 28//51\r
-f 28//51 31//54 32//55 27//50\r
-f 27//50 32//55 33//56 26//49\r
-f 26//49 33//56 34//57 25//48\r
-f 25//48 34//57 35//58 24//46\r
-f 24//46 35//58 36//59 23//47\r
-f 35//58 38//60 37//61 36//59\r
-f 34//57 39//62 38//60 35//58\r
-f 33//56 40//63 39//62 34//57\r
-f 32//55 41//64 40//63 33//56\r
-f 31//54 42//65 41//64 32//55\r
-f 30//53 43//66 42//65 31//54\r
-f 72//17 43//66 30//53\r
-f 72//17 44//67 43//66\r
-f 43//66 44//67 45//68 42//65\r
-f 42//65 45//68 46//69 41//64\r
-f 41//64 46//69 47//70 40//63\r
-f 40//63 47//70 48//71 39//62\r
-f 39//62 48//71 49//72 38//60\r
-f 38//60 49//72 50//73 37//61\r
-f 49//72 52//74 51//75 50//73\r
-f 48//71 53//76 52//74 49//72\r
-f 47//70 54//77 53//76 48//71\r
-f 46//69 55//78 54//77 47//70\r
-f 45//68 56//79 55//78 46//69\r
-f 44//67 57//80 56//79 45//68\r
-f 72//17 57//80 44//67\r
-f 72//17 58//81 57//80\r
-f 57//80 58//81 59//82 56//79\r
-f 56//79 59//82 60//83 55//78\r
-f 55//78 60//83 61//84 54//77\r
-f 54//77 61//84 62//85 53//76\r
-f 53//76 62//85 63//86 52//74\r
-f 52//74 63//86 64//87 51//75\r
-f 63//86 66//88 65//89 64//87\r
-f 62//85 67//90 66//88 63//86\r
-f 61//84 68//91 67//90 62//85\r
-f 60//83 69//92 68//91 61//84\r
-f 59//82 70//93 69//92 60//83\r
-f 58//81 71//94 70//93 59//82\r
-f 72//17 71//94 58//81\r
-f 72//17 73//95 71//94\r
-f 71//94 73//95 74//96 70//93\r
-f 70//93 74//96 75//97 69//92\r
-f 69//92 75//97 76//98 68//91\r
-f 68//91 76//98 77//99 67//90\r
-f 67//90 77//99 78//100 66//88\r
-f 66//88 78//100 79//101 65//89\r
-f 78//100 81//102 80//103 79//101\r
-f 77//99 82//104 81//102 78//100\r
-f 76//98 83//105 82//104 77//99\r
-f 75//97 84//106 83//105 76//98\r
-f 74//96 85//107 84//106 75//97\r
-f 73//95 86//108 85//107 74//96\r
-f 72//17 86//108 73//95\r
-f 72//17 87//109 86//108\r
-f 86//108 87//109 88//110 85//107\r
-f 85//107 88//110 89//111 84//106\r
-f 84//106 89//111 90//112 83//105\r
-f 83//105 90//112 91//113 82//104\r
-f 82//104 91//113 92//114 81//102\r
-f 81//102 92//114 93//115 80//103\r
-f 92//114 95//116 94//117 93//115\r
-f 91//113 96//118 95//116 92//114\r
-f 90//112 97//119 96//118 91//113\r
-f 89//111 98//120 97//119 90//112\r
-f 88//110 99//121 98//120 89//111\r
-f 87//109 100//122 99//121 88//110\r
-f 72//17 100//122 87//109\r
-f 72//17 101//123 100//122\r
-f 100//122 101//123 102//124 99//121\r
-f 99//121 102//124 103//125 98//120\r
-f 98//120 103//125 104//126 97//119\r
-f 97//119 104//126 105//127 96//118\r
-f 96//118 105//127 106//128 95//116\r
-f 95//116 106//128 107//129 94//117\r
-f 1//31 107//129 106//128 108//29\r
-f 105//127 109//27 108//29 106//128\r
-f 104//126 110//25 109//27 105//127\r
-f 103//125 111//23 110//25 104//126\r
-f 102//124 112//21 111//23 103//125\r
-f 101//123 113//19 112//21 102//124\r
-f 72//17 113//19 101//123\r
-f 107//129 1//31 129//130 114//131\r
-f 94//117 107//129 114//131 115//132\r
-f 93//115 94//117 115//132 116//133\r
-f 80//103 93//115 116//133 117//134\r
-f 79//101 80//103 117//134 118//135\r
-f 65//89 79//101 118//135 119//136\r
-f 64//87 65//89 119//136 120//137\r
-f 51//75 64//87 120//137 121//138\r
-f 50//73 51//75 121//138 122//139\r
-f 37//61 50//73 122//139 123//140\r
-f 36//59 37//61 123//140 124//141\r
-f 23//47 36//59 124//141 125//142\r
-f 22//45 23//47 125//142 126//143\r
-f 9//33 22//45 126//143 127//144\r
-f 8//30 9//33 127//144 128//145\r
-f 1//31 8//30 128//145 129//130\r
-f 130//146 131//147 132//148\r
-f 131//147 133//149 132//148\r
-f 133//149 134//150 132//148\r
-f 134//150 135//151 132//148\r
-f 135//151 136//152 132//148\r
-f 136//152 137//153 132//148\r
-f 137//153 138//154 132//148\r
-f 138//154 139//155 132//148\r
-f 139//155 140//156 132//148\r
-f 140//156 141//157 132//148\r
-f 141//157 142//158 132//148\r
-f 142//158 143//159 132//148\r
-f 143//159 144//160 132//148\r
-f 144//160 145//161 132//148\r
-f 145//161 146//162 132//148\r
-f 146//162 130//146 132//148\r
<extension\r
point="org.simantics.db.resourceAdapter">\r
<resource_adapter\r
- adapter_class="fi.vtt.simantics.processeditor.handlers.Plant3DProjectAdapter"\r
+ adapter_class="org.simantics.processeditor.handlers.Plant3DProjectAdapter"\r
operation="http://www.vtt.fi/Simantics/Layer0/1.0/Relations#HasProjectTypeAdapter"\r
type_uri="http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Plant3DProjectType">\r
</resource_adapter>\r
<resource_adapter\r
- adapter_class="fi.vtt.simantics.processeditor.adapters.NozzleConstraintAdapter"\r
+ adapter_class="org.simantics.processeditor.adapters.NozzleConstraintAdapter"\r
operation="http://www.vtt.fi/Simantics/G3D/1.0/Relations#HasConstraints"\r
type_uri="http://www.vtt.fi/Simantics/Plant3D/1.0/Types#Nozzle">\r
</resource_adapter>\r
<resource_adapter\r
- adapter_class="fi.vtt.simantics.processeditor.adapters.InlineComponentConstraintAdapter"\r
+ adapter_class="org.simantics.processeditor.adapters.InlineComponentConstraintAdapter"\r
operation="http://www.vtt.fi/Simantics/G3D/1.0/Relations#HasConstraints"\r
type_uri="http://www.vtt.fi/Simantics/Plant3D/1.0/Types#InlineComponent">\r
</resource_adapter>\r
<resource_adapter\r
- adapter_class="fi.vtt.simantics.processeditor.adapters.TurnComponentConstraintAdapter"\r
+ adapter_class="org.simantics.processeditor.adapters.TurnComponentConstraintAdapter"\r
operation="http://www.vtt.fi/Simantics/G3D/1.0/Relations#HasConstraints"\r
type_uri="http://www.vtt.fi/Simantics/Plant3D/1.0/Types#TurnComponent">\r
</resource_adapter>\r
<extension\r
point="org.eclipse.ui.editors">\r
<editor\r
- class="fi.vtt.simantics.processeditor.views.ProcessEditorPart"\r
+ class="org.simantics.processeditor.views.ProcessEditorPart"\r
icon="icons/factory.png"\r
id="org.simantics.proconf.processeditor.planteditor"\r
name="Plant Editor">\r
</editor>\r
<editor\r
- class="fi.vtt.simantics.processeditor.views.PipelineComponentEditorPart"\r
+ class="org.simantics.processeditor.views.PipelineComponentEditorPart"\r
icon="icons/Component.png"\r
id="org.simantics.proconf.processeditor.componenteditor"\r
name="Component Editor">\r
</editor>\r
<editor\r
- class="fi.vtt.simantics.processeditor.views.EquipmentEditorPart"\r
+ class="org.simantics.processeditor.views.EquipmentEditorPart"\r
icon="icons/tank.png"\r
id="org.simantics.proconf.processeditor.equipmenteditor"\r
name="Equipment Editor">\r
<extension\r
point="org.eclipse.ui.views">\r
<view\r
- class="fi.vtt.simantics.processeditor.views.PlantStructureView"\r
+ class="org.simantics.processeditor.views.PlantStructureView"\r
icon="icons/factory.png"\r
id="org.simantics.proconf.processeditor.plantstructure"\r
name="Plant Structure">\r
<extension\r
point="org.eclipse.ui.handlers">\r
<handler\r
- class="fi.vtt.simantics.processeditor.handlers.NewPlantHandler"\r
+ class="org.simantics.processeditor.handlers.NewPlantHandler"\r
commandId="org.simantics.proconf.processeditor.commands.newPlant">\r
</handler>\r
<handler\r
- class="fi.vtt.simantics.processeditor.handlers.NewEquipmentHandler"\r
+ class="org.simantics.processeditor.handlers.NewEquipmentHandler"\r
commandId="org.simantics.proconf.processeditor.commands.newEquipment">\r
</handler>\r
<handler\r
- class="fi.vtt.simantics.processeditor.handlers.NewComponentHandler"\r
+ class="org.simantics.processeditor.handlers.NewComponentHandler"\r
commandId="org.simantics.proconf.processeditor.commands.newComponent">\r
</handler>\r
</extension>\r
<extension\r
point="org.simantics.proconf.ui.resourceEditorAdapter">\r
<adapterClass\r
- class="fi.vtt.simantics.processeditor.handlers.Plant3DEditorAdapter"\r
+ class="org.simantics.processeditor.handlers.Plant3DEditorAdapter"\r
id="org.simantics.proconf.processeditor.ResourceEditorDescription1">\r
</adapterClass>\r
<adapterClass\r
- class="fi.vtt.simantics.processeditor.handlers.PipelineComponentEditorAdapter"\r
+ class="org.simantics.processeditor.handlers.PipelineComponentEditorAdapter"\r
id="org.simantics.proconf.processeditor.ResourceEditorDescription2">\r
</adapterClass>\r
<adapterClass\r
- class="fi.vtt.simantics.processeditor.handlers.EquipmentEditorAdapter"\r
+ class="org.simantics.processeditor.handlers.EquipmentEditorAdapter"\r
id="org.simantics.proconf.processeditor.ResourceEditorDescription3">\r
</adapterClass>\r
</extension>\r
<extension\r
point="org.eclipse.ui.perspectives">\r
<perspective\r
- class="fi.vtt.simantics.processeditor.perspectives.Plant3DModellingPerspective"\r
+ class="org.simantics.processeditor.perspectives.Plant3DModellingPerspective"\r
icon="icons/factory.png"\r
id="org.simantics.proconf.processeditor.plantmodelling"\r
name="3D Plant Modelling">\r
<extension\r
point="org.simantics.proconf.g3d.geometry">\r
<Geometry\r
- class="fi.vtt.simantics.processeditor.common.PipeComponentProvider"\r
+ class="org.simantics.processeditor.common.PipeComponentProvider"\r
id="org.simantics.proconf.processeditor.Geometry1">\r
</Geometry>\r
</extension>\r
+++ /dev/null
-package fi.vtt.simantics.processeditor.actions;\r
-\r
-\r
-/**\r
- * Position types for inserting new components and routing new pipe\r
- * \r
- * @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>\r
- *\r
- */\r
-public enum PositionType {\r
- SPLIT,\r
- NEXT,\r
- PREVIOUS,\r
- PORT\r
-}\r
+++ /dev/null
-package fi.vtt.simantics.processeditor.actions;\r
-\r
-import javax.vecmath.Point3d;\r
-\r
-/**\r
- * SplitPointListener is used by SplitPointAction to pass the selected split point.\r
- * Implementing class must set itself as active action into editor (SplitPointAction won't close automatically). \r
- * \r
- * @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>\r
- *\r
- */\r
-public interface SplitPointListener {\r
-\r
- /**\r
- * Sets selected split point, or null if user cancelled the action.\r
- * @param point\r
- */\r
- public void setSplitPoint(Point3d point);\r
-}\r
+++ /dev/null
-package fi.vtt.simantics.processeditor.handlers;\r
-\r
-import org.simantics.db.Graph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.adaption.AdaptionException;\r
-import org.simantics.db.adaption.ResourceAdapter;\r
-\r
-public class Plant3DProjectAdapter implements ResourceAdapter {\r
- @SuppressWarnings("unchecked")\r
- @Override\r
- public <T> T adapt(Graph graph, Resource resource, Resource mia) throws AdaptionException {\r
- return (T) new Plant3DProjectType(graph,resource);\r
- }\r
-}\r
+++ /dev/null
-package fi.vtt.simantics.processeditor.perspectives;\r
-\r
-import org.eclipse.ui.IPageLayout;\r
-import org.eclipse.ui.IPerspectiveFactory;\r
-\r
-public class Plant3DModellingPerspective implements IPerspectiveFactory{\r
- \r
- @Override\r
- public void createInitialLayout(IPageLayout layout) {\r
- \r
- }\r
-\r
-}\r
+++ /dev/null
-package fi.vtt.simantics.processeditor.views;\r
-\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.simantics.db.management.ISessionContext;\r
-import org.simantics.layer0.utils.viewpoints.ResourceViewpoint;\r
-import org.simantics.proconf.browsing.GraphExplorer;\r
-import org.simantics.proconf.browsing.views.GraphExplorerView;\r
-\r
-import fi.vtt.simantics.processeditor.perspectives.ViewpointGenerator;\r
-\r
-public class PlantStructureView extends GraphExplorerView {\r
-\r
- @Override\r
- protected GraphExplorer createExplorer(Composite parent) {\r
- return super.createExplorer(parent);\r
- }\r
- \r
- @Override\r
- protected ResourceViewpoint getViewpoint(ISessionContext context) {\r
- return ViewpointGenerator.createViewpoint();\r
- }\r
-}\r
+++ /dev/null
-/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package fi.vtt.simantics.processeditor.views;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.eclipse.jface.action.Action;\r
-import org.eclipse.jface.dialogs.Dialog;\r
-import org.eclipse.jface.dialogs.IDialogConstants;\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.eclipse.jface.viewers.ISelectionChangedListener;\r
-import org.eclipse.jface.viewers.SelectionChangedEvent;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.events.KeyEvent;\r
-import org.eclipse.swt.events.KeyListener;\r
-import org.eclipse.swt.events.SelectionEvent;\r
-import org.eclipse.swt.events.SelectionListener;\r
-import org.eclipse.swt.layout.GridData;\r
-import org.eclipse.swt.widgets.Button;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Label;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.eclipse.swt.widgets.Text;\r
-import org.eclipse.ui.IWorkbenchPart;\r
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;\r
-import org.simantics.db.Graph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.Session;\r
-import org.simantics.db.management.ISessionContext;\r
-import org.simantics.layer0.utils.EntityFactory;\r
-import org.simantics.layer0.utils.IEntity;\r
-import org.simantics.layer0.utils.Property;\r
-import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
-import org.simantics.proconf.g3d.base.ScenegraphAdapter;\r
-import org.simantics.proconf.g3d.base.ScenegraphAdapterImpl;\r
-import org.simantics.proconf.g3d.base.SelectionAdapter;\r
-import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
-import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
-import org.simantics.proconf.g3d.scenegraph.IGeometryNode;\r
-import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
-import org.simantics.proconf.g3d.scenegraph.ISelectableNode;\r
-import org.simantics.proconf.g3d.scenegraph.ParameterizedModelNode;\r
-import org.simantics.proconf.g3d.shapes.FloorShape;\r
-import org.simantics.proconf.g3d.stubs.G3DNode;\r
-import org.simantics.utils.ErrorLogger;\r
-import org.simantics.utils.ui.jface.MenuTools;\r
-\r
-import com.jme.math.Vector3f;\r
-import com.jme.scene.Geometry;\r
-\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.actions.InsertComponentAction;\r
-import fi.vtt.simantics.processeditor.actions.InsertEquipmentAction;\r
-import fi.vtt.simantics.processeditor.actions.InsertNozzleAction;\r
-import fi.vtt.simantics.processeditor.actions.RoutePipeAction;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingRules;\r
-import fi.vtt.simantics.processeditor.scenegraph.NonVisibleNode;\r
-import fi.vtt.simantics.processeditor.scenegraph.PipelineComponentNode;\r
-import fi.vtt.simantics.processeditor.scenegraph.PipeComponentNode;\r
-import fi.vtt.simantics.processeditor.scenegraph.PipeRunNode;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.stubs.Plant;\r
-import fi.vtt.simantics.processeditor.stubs.Plant3DResource;\r
-import fi.vtt.simantics.processeditor.tools.PlantEditContribution;\r
-import fi.vtt.simantics.processeditor.tools.PlantVisualizationContribution;\r
-\r
-public class ProcessEditor extends ThreeDimensionalEditorBase {\r
- \r
- private Resource plantResource = null;\r
- \r
- //private List<AnimationController> animationControllers = new ArrayList<AnimationController>();\r
-\r
- private Action configureFloorAction = null;\r
-\r
- private Geometry floorShape = null;\r
-\r
- public ProcessEditor(ISessionContext session) {\r
- super(session);\r
- addEditorContribution(new PlantEditContribution(this));\r
- addEditorContribution(new PlantVisualizationContribution(this));\r
- }\r
- \r
- public ProcessEditor(ISessionContext session,JmeRenderingComponent component) {\r
- super(session,component);\r
- addEditorContribution(new PlantEditContribution(this));\r
- addEditorContribution(new PlantVisualizationContribution(this));\r
- }\r
- \r
- @Override\r
- protected ScenegraphAdapter createScenegraphAdapter() {\r
- return new ProcessEditorAdapter(session,getRenderingComponent());\r
- }\r
- \r
- @Override\r
- public void createControl(Graph graph,Composite parent) {\r
- super.createControl(graph,parent);\r
-\r
- floorShape = FloorShape.getShape(getRenderingComponent().getDisplaySystem().getRenderer(), 100.f,0.2f);\r
- getRenderingComponent().getNoCastRoot().attachChild(floorShape);\r
- floorShape.setLocalTranslation(new Vector3f(0.f,-0.01f,0.f));\r
- }\r
-\r
- @Override\r
- protected void makeActions(Graph graph) {\r
- super.makeActions(graph);\r
-\r
- //actions.add(new ShowTrendsAction(this));\r
-\r
- configureFloorAction = new Action() {\r
- public void run() {\r
- FloorConfigureDialog dialog = new FloorConfigureDialog(ProcessEditor.this.parent.getShell());\r
- if (dialog.open() == FloorConfigureDialog.CANCEL)\r
- return;\r
- if (dialog.isFloorEnabled()) {\r
- if (floorShape.getParent() == null)\r
- getRenderingComponent().getNoCastRoot().attachChild(floorShape);\r
- } else {\r
- floorShape.removeFromParent();\r
- }\r
- floorShape.setLocalTranslation(new Vector3f(0.f,(float)dialog.getFloorHeight(),0.f));\r
- \r
- }\r
- };\r
- configureFloorAction.setText("Configure floor");\r
- configureFloorAction.setImageDescriptor(Activator.imageDescriptorFromPlugin("fi.vtt.proconf.ode", "icons/silk/shape_align_bottom.png"));\r
-\r
-// ContextActionFactory extended[] = ContextActionRegistry.getActions("fi.vtt.proconf.shapeeditor.processeditorview");\r
-// for (ContextActionFactory c : extended) {\r
-// actions.add(c.createAction(this));\r
-// }\r
- }\r
- \r
-// protected void stopAnimations() {\r
-// animationSystem.stop();\r
-// }\r
- \r
- protected void fillLocalPullDown() {\r
- super.fillLocalPullDown();\r
- MenuTools.getOrCreate(getMenuID(),"Advanced", menuManager).add(configureFloorAction);\r
- }\r
- \r
- protected class ProcessEditorAdapter extends ScenegraphAdapterImpl {\r
- \r
- public ProcessEditorAdapter(Session session, JmeRenderingComponent component) {\r
- super(session, component);\r
- }\r
- \r
- private class NormalScengraphQuery extends ScenegraphQuery {\r
- \r
- public NormalScengraphQuery(Resource node) {\r
- super(node);\r
- } \r
- \r
- \r
- @Override\r
- public void shapeAdded(Graph graph, IGraphicsNode node) {\r
- // FIXME : this won't work like in previous ProConf\r
- }\r
- }\r
- \r
- private Map<Resource,PipeRunControlPointQuery> pipeRunQueries = new HashMap<Resource, PipeRunControlPointQuery>();\r
-\r
- protected ScenegraphQuery newSubnodeListener(G3DNode node) {\r
- if (node.isInstanceOf(ProcessResource.plant3Dresource.PipeRun)) {\r
- PipeRunControlPointQuery query = new PipeRunControlPointQuery(node.getResource());\r
- pipeRunQueries.put(node.getResource(), query);\r
- node.getGraph().performQuery(query);\r
-// return new SubnodeListener(node) {\r
-// @Override\r
-// public void shapeAdded(IGraphicsNode node) {\r
-// if (node instanceof IGeometryNode) {\r
-// updateGeometry((IGeometryNode)node);\r
-// \r
-// }\r
-// node.setVisible(true);\r
-// }\r
-// };\r
- }\r
- return new NormalScengraphQuery(node.getResource());\r
- \r
- }\r
- \r
- @Override\r
- protected NodePropertyQuery newRootPropertyListener(G3DNode root) {\r
- // currently Plant does not have any properties.\r
- return null;\r
- }\r
- \r
- private class TransformationQuery extends NodeTransformationQuery {\r
- \r
- public TransformationQuery(Resource res) {\r
- super(res);\r
- }\r
- \r
- @Override\r
- public void shapeUpdated(Graph graph, IGraphicsNode shape) {\r
- //if (shape instanceof IGeometryNode) {\r
- // updateGeometry((IGeometryNode)shape);\r
- //} else {\r
- shape.updateTransform(graph);\r
- //}\r
- }\r
- }\r
- \r
- @Override\r
- protected NodeTransformationQuery newTransformationListener(G3DNode root) {\r
- return new TransformationQuery(root.getResource());\r
- }\r
- \r
- private class NormalNodePropertyQuery extends org.simantics.proconf.g3d.base.ScenegraphAdapterImpl.NodePropertyQuery {\r
- \r
- public NormalNodePropertyQuery(Resource resource) {\r
- super(resource);\r
- }\r
-\r
- @Override\r
- public void shapeUpdated(Graph graph,IGraphicsNode shape) {\r
- if (shape instanceof IGeometryNode) {\r
- updateGeometry((IGeometryNode)shape);\r
- } else {\r
- shape.updateTransform(graph);\r
- }\r
- }\r
- }\r
- @Override\r
- protected NodePropertyQuery newPropertyListener(G3DNode node) {\r
- return new NormalNodePropertyQuery(node.getResource());\r
- }\r
- \r
- @Override\r
- protected IGraphicsNode instantiateNode(IGraphicsNode parent,\r
- G3DNode node) {\r
- Plant3DResource p3r = ProcessResource.plant3Dresource;\r
- IGraphicsNode newNode = null;\r
- try {\r
- if (node.isInstanceOf(p3r.Equipment)) {\r
- newNode = new ParameterizedModelNode(\r
- ProcessEditor.this, parent, node.getGraph(),\r
- node.getResource(), p3r.HasGraphics);\r
- } else if (node.isInstanceOf(p3r.PipeRun)) {\r
- newNode = new PipeRunNode(parent, node.getGraph(), node.getResource());\r
- } else if (node.isInstanceOf(p3r.Nozzle)) {\r
- newNode = new ParameterizedModelNode(\r
- ProcessEditor.this, parent, node.getGraph(),\r
- node.getResource(), p3r.HasGraphics);\r
- // CodedComponent must be handled first since it uses\r
- // hard-coded geometries\r
- // TODO : is this really necessary, or could we unify\r
- // PipeComponentNode, InlineComponentNode,...\r
- } else if (node.isInstanceOf(p3r.CodedComponent)) {\r
- newNode = new PipeComponentNode(ProcessEditor.this,\r
- parent, node.getGraph(), node.getResource());\r
- } else if (node.isInstanceOf(p3r.NonVisibleComponent)) {\r
- newNode = new NonVisibleNode(parent, node.getGraph(), node.getResource());\r
- } else if (node.isInstanceOf(p3r.PipelineComponent)) {\r
- newNode = new PipelineComponentNode(ProcessEditor.this,\r
- parent, node.getGraph(), node.getResource());\r
- } \r
-\r
- // } else if (node instanceof Shape) // Markers (ar/mobile)\r
- // needed this\r
- // newNode = new ShapeNode(TestProcessEditor.this,parent,node);\r
- if (newNode != null) {\r
- if (newNode instanceof ISelectableNode)\r
- ((ISelectableNode) newNode).setVisible(true);\r
- if (newNode instanceof IGeometryNode) {\r
- updateGeometry((IGeometryNode) newNode);\r
- }\r
- return newNode;\r
- }\r
- } catch (Exception e) {\r
- ErrorLogger.defaultLogError("Cannot handle node " + node.getResource(), e);\r
- return null;\r
- }\r
- ErrorLogger.defaultLogError("Cannot handle node " + node.getResource(), null);\r
- return null;\r
-\r
- }\r
-\r
- /**\r
- * This is used to create elbows and straight pipes to pipeline TODO :\r
- * this should be done with rule-engine!\r
- * \r
- * \r
- * @author Marko Luukkainen\r
- * \r
- */\r
- protected class PipeRunControlPointQuery extends NodeQuery {\r
- private List<Resource> removed = new ArrayList<Resource>();\r
- private List<Resource> added = new ArrayList<Resource>();\r
-\r
- public PipeRunControlPointQuery(Resource r) {\r
- super(r);\r
- if (DEBUG) System.out.println("Created PipeRunControlPointQuery for " + r);\r
-\r
- }\r
-\r
- @Override\r
- protected Object compute2(Graph graph) {\r
- PipeRun run = new PipeRun(graph, nodeResource);\r
- Collection<IEntity> cps = run\r
- .getRelatedObjects(ProcessResource.plant3Dresource.HasControlPoints);\r
- List<Resource> res = new ArrayList<Resource>();\r
- for (IEntity t : cps)\r
- res.add(t.getResource());\r
- return res;\r
- }\r
-\r
- @Override\r
- public boolean updated(Graph graph, Object oldResult,\r
- Object newResult) {\r
- \r
- removed.clear();\r
- added.clear();\r
-\r
- List<Resource> oldCps = (List<Resource>) oldResult;\r
- List<Resource> newCps = (List<Resource>) newResult;\r
- if (oldCps == null)\r
- oldCps = new ArrayList<Resource>();\r
-\r
- for (Resource r : oldCps) {\r
- if (!newCps.contains(r))\r
- removed.add(r);\r
- }\r
-\r
- for (Resource r : newCps) {\r
- if (!oldCps.contains(r))\r
- added.add(r);\r
- }\r
- for (Resource r : removed)\r
- removeControlPoint(graph, r);\r
- for (Resource r : added) {\r
- addControlPoint(graph, r);\r
- // ControlPointTools.addControlPoint(new\r
- // PipeRun(graph,pipeRun), new PipeControlPoint(graph, r));\r
- }\r
-\r
- return (added.size() > 0 || removed.size() > 0);\r
- }\r
- \r
- @Override\r
- public void dispose() {\r
- super.dispose();\r
- for (ControlPointPropertyQuery q : controlPointPropertyQueries.values())\r
- q.dispose();\r
- controlPointPropertyQueries.clear();\r
- }\r
- \r
- private Map<Resource,ControlPointPropertyQuery> controlPointPropertyQueries = new HashMap<Resource, ControlPointPropertyQuery>();\r
- \r
- private void addControlPoint(Graph graph, Resource resource) {\r
- ControlPointPropertyQuery query = new ControlPointPropertyQuery(resource);\r
- graph.performQuery(query);\r
- controlPointPropertyQueries.put(resource,query);\r
- }\r
- \r
- private void removeControlPoint(Graph graph, Resource resource) {\r
- ControlPointPropertyQuery query = controlPointPropertyQueries.remove(resource);\r
- query.dispose();\r
- ControlPointTools.removeControlPoint(new PipeControlPoint(\r
- graph, resource));\r
- }\r
-\r
- }\r
-\r
- protected class ControlPointPropertyQuery extends NodeQuery {\r
- boolean initialized = false;\r
- \r
- public ControlPointPropertyQuery(Resource r) {\r
- super(r);\r
- if (DEBUG) System.out.println("Created ControlPointPropertyQuery for " + r);\r
- }\r
- \r
- @Override\r
- public List<Object> compute2(Graph g) {\r
- IEntity t = EntityFactory.create(g,nodeResource);\r
- \r
- Collection<Property> properties = t.getRelatedProperties(ProcessResource.builtins.HasProperty);\r
- List<Object> propertyValues = new ArrayList<Object>();\r
- p(properties,propertyValues);\r
-\r
- return propertyValues;\r
- }\r
- \r
- private void p(Collection<Property> properties, List<Object> propertyValues) {\r
- for (Property p : properties) {\r
- Collection<Property> subProperties = p.getRelatedProperties(p.getGraph().getBuiltins().HasProperty);\r
- if (subProperties.size() != 0) {\r
- p(subProperties,propertyValues);\r
- } \r
- if (p.hasValue()){\r
- propertyValues.add(p.getValue());\r
- }\r
- }\r
- }\r
- \r
- @Override\r
- public boolean updated(Graph graph, Object oldResult, Object newResult) {\r
- PipingRules.pipeControlPointPositionUpdate(graph, this.nodeResource);\r
- if (initialized) {\r
- //PipingRules.pipeControlPointPositionUpdate(graph, this.nodeResource);\r
- } else {\r
- initialized = true;\r
- }\r
- return true;\r
- }\r
- }\r
- \r
- @Override\r
- protected void removeNode(Resource parent, Resource r) {\r
- super.removeNode(parent, r);\r
- PipeRunControlPointQuery q = pipeRunQueries.get(r);\r
- if (q != null)\r
- q.dispose();\r
- }\r
- \r
- @Override\r
- public void dispose() {\r
- super.dispose();\r
- }\r
- }\r
- \r
- @Override\r
- protected void pageSelectionChanged(IWorkbenchPart part, ISelection selection) {\r
- if (!(selection instanceof StructuredResourceSelection)) {\r
- return;\r
- }\r
- \r
- StructuredResourceSelection s = (StructuredResourceSelection) selection;\r
- selectionAdapter.setCurrentSelection(s);\r
- viewChanged = true;\r
- \r
- //if (s.getRootSelection() == null) {\r
- if (!(part instanceof ProcessEditor)) {\r
- //System.out.println("ShapeEditorView.pageSelectionChanged() no root selection");\r
- ((ProcessEditorSelectionAdapter)selectionAdapter).setEditorSelection(true);\r
- return;\r
- } \r
- //if (!s.getRootSelection().getResource().getId().equals(plant.getResource().getId())) {\r
- ProcessEditor sender = (ProcessEditor)part;\r
- if (!sender.getPlantResource().equals(plantResource)) {\r
-// System.out.println("ShapeEditorView.pageSelectionChanged() not right group "\r
-// + s.getRootSelection().getResource().getId() + " != " + model.getResource().getId());\r
- selectionAdapter.setCurrentSelection(new StructuredResourceSelection());\r
- ((ProcessEditorSelectionAdapter)selectionAdapter).setEditorSelection(false);\r
- return;\r
- }\r
- selectionAdapter.setEditorSelection();\r
- \r
- }\r
-\r
- @Override\r
- protected void reloadFrom(IEntity thing) {\r
- if (plantResource != null) {\r
- throw new UnsupportedOperationException("Reloading instantiated viewer not supported");\r
- }\r
- if (thing.isInstanceOf(ProcessResource.plant3Dresource.Plant)) {\r
- plantResource = thing.getResource();\r
- G3DNode plant = new G3DNode(thing);\r
- adapter.setRootNode(plant);\r
- //adapter.addOutbound(plant);\r
- ControlPointTools.reloadCache(thing.getGraph(),plant.getResource());\r
- } else {\r
- throw new IllegalArgumentException("Resource is not a plant");\r
- } \r
- }\r
-\r
- public Resource getPlantResource() {\r
- return plantResource;\r
- }\r
- \r
- public Plant getPlant(Graph g) {\r
- return new Plant(g, plantResource);\r
- }\r
- \r
- @Override\r
- protected SelectionAdapter createSelectionAdapter() {\r
- return new ProcessEditorSelectionAdapter(adapter);\r
- }\r
- \r
- protected class ProcessEditorSelectionAdapter extends SelectionAdapter {\r
- \r
- \r
- public ProcessEditorSelectionAdapter(ScenegraphAdapter adapter) {\r
- super(adapter);\r
- // TODO Auto-generated constructor stub\r
- }\r
-\r
- @Override\r
- protected StructuredResourceSelection filterSelection(ISelection s) {\r
- if (!(s instanceof StructuredResourceSelection))\r
- return new StructuredResourceSelection();\r
- return (StructuredResourceSelection)s;\r
- }\r
-\r
- @Override\r
- public void setEditorSelection() {\r
- List<IGraphicsNode> sel = getSelectedObjects();\r
- for (IGraphicsNode o : adapter.getNodes())\r
- if (o instanceof ISelectableNode) {\r
- if (sel.contains(o)) {\r
- ((ISelectableNode)o).setSelected(true);\r
- } else {\r
- ((ISelectableNode)o).setSelected(false);\r
- }\r
- }\r
- List<Resource> selected = getSelectedResources();\r
- // TODO : don't know why this code is here, but it seems unnecessary\r
-// for (Resource r : selected) {\r
-// if (!adapter.hasNode(r)) {\r
-// // instantiating a new resource : usin this editor's tc\r
-// Resource resource = graph.getResource(r.getId());\r
-// adapter.addInbound(resource).setSelected(true);\r
-//\r
-// }\r
-// }\r
- \r
- }\r
- \r
- public void setEditorSelection(boolean addShapes) {\r
-\r
- List<IGraphicsNode> sel = getSelectedObjects();\r
- for (IGraphicsNode o : adapter.getNodes())\r
- if (o instanceof ISelectableNode) {\r
- if (sel.contains(o)) {\r
- ((ISelectableNode)o).setSelected(true);\r
- } else {\r
- ((ISelectableNode)o).setSelected(false);\r
- }\r
- }\r
- if (addShapes) {\r
- // TODO : don't know why this code is here, but it seems unnecessary\r
-// List<Resource> selected = getSelectedResources();\r
-// for (Resource r : selected) {\r
-// if (!adapter.hasNode(r)) {\r
-// if (r.isInstanceOf(GlobalIdMap.get(PSK3DModelingOntologyMapping.EQUIPMENT))) {\r
-// Resource group = GraphicsNodeTools.getModelFromResource(r);\r
-// if (group != null && group.getId() == plant.getResource().getId()) {\r
-//// instantiating a new resource : usin this editor's tc\r
-// Resource resource = graph.getResource(r.getId());\r
-// adapter.addInbound(resource).setSelected(true);\r
-// }\r
-// \r
-// }\r
-// }\r
-// }\r
- }\r
- }\r
-\r
- @Override\r
- protected void setEditorHighlightSelection() {\r
- List<IGraphicsNode> sel = getInteractiveSelectedObjects();\r
- for (IGraphicsNode o : adapter.getNodes())\r
- if (o instanceof ISelectableNode) {\r
- if (sel.contains(o)) {\r
- ((ISelectableNode)o).setHighlighted(true);\r
- } else {\r
- ((ISelectableNode)o).setHighlighted(false);\r
- }\r
- }\r
- }\r
- }\r
- \r
- private class FloorConfigureDialog extends Dialog implements KeyListener,SelectionListener {\r
- \r
- private boolean floorEnabled = true;\r
- private double floorHeight = 0.0;\r
- \r
- private Text floorHeightText = null;\r
- private Button floorEnabledButton = null;\r
- \r
- public FloorConfigureDialog(Shell shell) {\r
- super(shell);\r
- }\r
- \r
- @Override\r
- protected Control createDialogArea(Composite parent) {\r
- Composite composite = (Composite) super.createDialogArea(parent);\r
- Label label = new Label(composite, SWT.WRAP);\r
- label.setText("Configure floor");\r
- GridData data = new GridData(GridData.GRAB_HORIZONTAL\r
- | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL\r
- | GridData.VERTICAL_ALIGN_CENTER);\r
- \r
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);\r
- label.setLayoutData(data);\r
- label.setFont(parent.getFont());\r
- floorEnabledButton = new Button(composite,SWT.CHECK);\r
- floorEnabledButton.setText("Enabled");\r
- label = new Label(composite, SWT.WRAP);\r
- label.setText("Height");\r
- label.setLayoutData(data);\r
- label.setFont(parent.getFont());\r
- floorHeightText = new Text(composite,SWT.NONE);\r
- \r
- \r
- floorHeightText.addKeyListener(this);\r
- floorEnabledButton.addSelectionListener(this);\r
- floorEnabledButton.setSelection(floorEnabled);\r
- floorHeightText.setText(Double.toString(floorHeight));\r
- \r
- return composite;\r
- }\r
- \r
- @Override\r
- protected void configureShell(Shell newShell) {\r
- super.configureShell(newShell);\r
- newShell.setText("Configure floor");\r
- }\r
- \r
- public void keyPressed(KeyEvent e) {\r
- \r
- }\r
- \r
- public void keyReleased(KeyEvent e) {\r
- boolean ok = true;\r
- try {\r
- floorHeight = Double.parseDouble(floorHeightText.getText()); \r
- } catch (NumberFormatException err) {\r
- ok = false;\r
- }\r
- if (ok) {\r
- this.getButton(IDialogConstants.OK_ID).setEnabled(true);\r
- } else {\r
- this.getButton(IDialogConstants.OK_ID).setEnabled(false);\r
- }\r
- }\r
- \r
- public void widgetDefaultSelected(SelectionEvent e) {\r
- \r
- }\r
- \r
- public void widgetSelected(SelectionEvent e) {\r
- floorEnabled = floorEnabledButton.getSelection();\r
- }\r
-\r
- public boolean isFloorEnabled() {\r
- return floorEnabled;\r
- }\r
-\r
- public double getFloorHeight() {\r
- return floorHeight;\r
- }\r
-\r
- }\r
- \r
- @Override\r
- protected void hookDragAndDrop() {\r
- super.hookDragAndDrop();\r
- dropTarget.addDropListener(new InsertEquipmentAction(this));\r
- dropTarget.addDropListener(new InsertNozzleAction(this));\r
- dropTarget.addDropListener(new InsertComponentAction(this));\r
- dropTarget.addDropListener(new RoutePipeAction(this));\r
- }\r
- \r
- @Override\r
- public Object getAdapter(Class adapter) {\r
- if (adapter == IContentOutlinePage.class) {\r
- if (getPlantResource() == null)\r
- return null;\r
- final PlantStructureOutlinePage page = new PlantStructureOutlinePage(sessionContext,getPlantResource());\r
- \r
- getSelectionAdapter().addSelectionChangedListener(new ISelectionChangedListener() {\r
- @Override\r
- public void selectionChanged(SelectionChangedEvent event) {\r
- page.setSelection(event.getSelection());\r
- \r
- }\r
- });\r
- parent.getDisplay().asyncExec(new Runnable() {\r
- @Override\r
- public void run() {\r
- page.addSelectionChangedListener(new ISelectionChangedListener() {\r
- @Override\r
- public void selectionChanged(SelectionChangedEvent event) {\r
- selectionAdapter.setSelection(SelectionAdapter.transformSelection(event.getSelection()));\r
- }\r
- });\r
- }\r
- });\r
- \r
- \r
- \r
- return page;\r
- }\r
- return null;\r
- }\r
-}
\ No newline at end of file
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor;\r
+package org.simantics.processeditor;\r
\r
import org.eclipse.ui.plugin.AbstractUIPlugin;\r
import org.osgi.framework.BundleContext;\r
public class Activator extends AbstractUIPlugin {\r
\r
// The plug-in ID\r
- public static final String PLUGIN_ID = "fi.vtt.simantics.processeditor";\r
+ public static final String PLUGIN_ID = "org.simantics.processeditor";\r
\r
// The shared instance\r
private static Activator plugin;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor;\r
+package org.simantics.processeditor;\r
\r
import org.simantics.db.Builtins;\r
import org.simantics.db.Graph;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.Plant3DResource;\r
import org.simantics.proconf.g3d.stubs.G3DResource;\r
\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.stubs.Plant3DResource;\r
\r
public class ProcessResource {\r
public static Builtins builtins;\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.actions;\r
+\r
+import org.eclipse.jface.action.Action;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.dialogs.FloorConfigureDialog;\r
+import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
+\r
+import com.jme.math.Vector3f;\r
+import com.jme.scene.Geometry;\r
+\r
+public class ConfigureFloorAction extends Action {\r
+ \r
+ Geometry floorShape;\r
+ ThreeDimensionalEditorBase editor;\r
+ \r
+ public ConfigureFloorAction(ThreeDimensionalEditorBase editor) {\r
+ setText("Configure floor");\r
+ setImageDescriptor(Activator.imageDescriptorFromPlugin("fi.vtt.proconf.ode", "icons/silk/shape_align_bottom.png"));\r
+ this.editor = editor;\r
+ }\r
+ \r
+ public void run() {\r
+ if (floorShape == null)\r
+ throw new NullPointerException("FloorShape is null");\r
+ FloorConfigureDialog dialog = new FloorConfigureDialog(editor.getRenderingComposite().getShell());\r
+ if (dialog.open() == FloorConfigureDialog.CANCEL)\r
+ return;\r
+ if (dialog.isFloorEnabled()) {\r
+ if (floorShape.getParent() == null)\r
+ editor.getRenderingComponent().getNoCastRoot().attachChild(floorShape);\r
+ } else {\r
+ floorShape.removeFromParent();\r
+ }\r
+ floorShape.setLocalTranslation(new Vector3f(0.f,(float)dialog.getFloorHeight(),0.f));\r
+ \r
+ }\r
+ \r
+ public void setFloorShape(Geometry floorShape) {\r
+ this.floorShape = floorShape;\r
+ }\r
+\r
+}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.awt.event.KeyEvent;\r
import java.awt.event.MouseEvent;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.common.PipingTools2.Direction;\r
+import org.simantics.processeditor.dialogs.PipelineComponentDialog;\r
+import org.simantics.processeditor.gizmo.PositionSelectionGizmo;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
import org.simantics.proconf.g3d.actions.InteractiveAction;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.utils.datastructures.Pair;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2.Direction;\r
-import fi.vtt.simantics.processeditor.dialogs.PipelineComponentDialog;\r
-import fi.vtt.simantics.processeditor.gizmo.PositionSelectionGizmo;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
\r
\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.dialogs.EquipmentDialog;\r
+import org.simantics.processeditor.stubs.Equipment;\r
import org.simantics.proconf.g3d.actions.ContextAction;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.dialogs.EquipmentDialog;\r
-import fi.vtt.simantics.processeditor.stubs.Equipment;\r
\r
public class InsertEquipmentAction extends ContextAction implements DropListener{\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.instantiation.Instance;\r
import org.simantics.layer0.utils.instantiation.InstanceFactory;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.dialogs.NozzleDialog;\r
+import org.simantics.processeditor.stubs.Equipment;\r
+import org.simantics.processeditor.stubs.Nozzle;\r
import org.simantics.proconf.g3d.actions.WriteAction;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
import org.simantics.proconf.g3d.dnd.DropListener;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.dialogs.NozzleDialog;\r
-import fi.vtt.simantics.processeditor.stubs.Equipment;\r
-import fi.vtt.simantics.processeditor.stubs.Nozzle;\r
\r
\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.actions;\r
+\r
+\r
+/**\r
+ * Position types for inserting new components and routing new pipe\r
+ * \r
+ * @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>\r
+ *\r
+ */\r
+public enum PositionType {\r
+ SPLIT,\r
+ NEXT,\r
+ PREVIOUS,\r
+ PORT\r
+}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
import org.simantics.proconf.g3d.actions.WriteAction;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
\r
public class ReversePipelineAction extends WriteAction {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.awt.event.KeyEvent;\r
import java.awt.event.MouseEvent;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipeComponentProvider;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.common.PipingTools2.Direction;\r
+import org.simantics.processeditor.dialogs.PipelineDialog;\r
+import org.simantics.processeditor.gizmo.PositionSelectionGizmo;\r
+import org.simantics.processeditor.stubs.BranchEndControlPoint;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
+import org.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
+import org.simantics.processeditor.views.ProcessEditor;\r
import org.simantics.proconf.g3d.actions.InteractiveAction;\r
import org.simantics.proconf.g3d.base.ConstraintDetector;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import com.jme.scene.Line;\r
import com.jme.scene.state.MaterialState;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipeComponentProvider;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2.Direction;\r
-import fi.vtt.simantics.processeditor.dialogs.PipelineDialog;\r
-import fi.vtt.simantics.processeditor.gizmo.PositionSelectionGizmo;\r
-import fi.vtt.simantics.processeditor.stubs.BranchEndControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
-import fi.vtt.simantics.processeditor.views.ProcessEditor;\r
\r
/**\r
* Action for Routing Pipes\r
-package fi.vtt.simantics.processeditor.actions;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.actions;\r
\r
import java.awt.event.MouseEvent;\r
import java.util.List;\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.actions;\r
+\r
+import javax.vecmath.Point3d;\r
+\r
+/**\r
+ * SplitPointListener is used by SplitPointAction to pass the selected split point.\r
+ * Implementing class must set itself as active action into editor (SplitPointAction won't close automatically). \r
+ * \r
+ * @author Marko Luukkainen <Marko.Luukkainen@vtt.fi>\r
+ *\r
+ */\r
+public interface SplitPointListener {\r
+\r
+ /**\r
+ * Sets selected split point, or null if user cancelled the action.\r
+ * @param point\r
+ */\r
+ public void setSplitPoint(Point3d point);\r
+}\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.DirectedControlPoint;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.VariableAngleTurnComponent;\r
import org.simantics.proconf.g3d.actions.ConstrainedTransformAction;\r
import org.simantics.proconf.g3d.actions.TranslateActionConstraints;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.stubs.DirectedControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.VariableAngleTurnComponent;\r
\r
public class TranslateElbowAction extends ConstrainedTransformAction {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.stubs.InlineComponent;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
import org.simantics.proconf.g3d.actions.ConstrainedTransformAction;\r
import org.simantics.proconf.g3d.base.G3DAPI;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.stubs.InlineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
\r
\r
public class TranslateInlineComponentAction extends ConstrainedTransformAction {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.actions;\r
+package org.simantics.processeditor.actions;\r
\r
import java.util.List;\r
\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipingTools2;\r
+import org.simantics.processeditor.stubs.FixedLengthInlineComponent;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
import org.simantics.proconf.g3d.actions.ConstrainedTransformAction;\r
import org.simantics.proconf.g3d.actions.TranslateActionConstraints;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.gizmo.TransformGizmo;\r
import org.simantics.proconf.g3d.gizmo.TransformInlineGizmo;\r
\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.stubs.FixedLengthInlineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
\r
/**\r
-package fi.vtt.simantics.processeditor.adapters;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.adapters;\r
\r
import javax.vecmath.Point3d;\r
import javax.vecmath.Vector3d;\r
import org.simantics.db.adaption.ResourceAdapter;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
import org.simantics.proconf.g3d.base.Constraint;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
\r
public class InlineComponentConstraintAdapter implements ResourceAdapter {\r
@SuppressWarnings("unchecked")\r
-package fi.vtt.simantics.processeditor.adapters;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.adapters;\r
\r
import javax.vecmath.Point3d;\r
import javax.vecmath.Vector3d;\r
import org.simantics.db.adaption.ResourceAdapter;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipingTools2;\r
import org.simantics.proconf.g3d.base.Constraint;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
\r
public class NozzleConstraintAdapter implements ResourceAdapter {\r
@SuppressWarnings("unchecked")\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.adapters;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Collection;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.simantics.db.Graph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.layer0.utils.EntityFactory;\r
+import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.layer0.utils.Property;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipingRules;\r
+import org.simantics.processeditor.scenegraph.NonVisibleNode;\r
+import org.simantics.processeditor.scenegraph.PipeComponentNode;\r
+import org.simantics.processeditor.scenegraph.PipeRunNode;\r
+import org.simantics.processeditor.scenegraph.PipelineComponentNode;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
+import org.simantics.processeditor.stubs.Plant3DResource;\r
+import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
+import org.simantics.proconf.g3d.base.ScenegraphAdapterImpl;\r
+import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
+import org.simantics.proconf.g3d.scenegraph.IGeometryNode;\r
+import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
+import org.simantics.proconf.g3d.scenegraph.ISelectableNode;\r
+import org.simantics.proconf.g3d.scenegraph.ParameterizedModelNode;\r
+import org.simantics.proconf.g3d.stubs.G3DNode;\r
+import org.simantics.utils.ui.ErrorLogger;\r
+\r
+public class ProcessEditorAdapter extends ScenegraphAdapterImpl {\r
+ private ThreeDimensionalEditorBase editor;\r
+ \r
+ public ProcessEditorAdapter(ThreeDimensionalEditorBase editor, Session session, JmeRenderingComponent component) {\r
+ super(session, component);\r
+ this.editor = editor;\r
+ }\r
+ \r
+ private class NormalScenegraphQuery extends ScenegraphQuery {\r
+ \r
+ public NormalScenegraphQuery(Resource node) {\r
+ super(node);\r
+ } \r
+ \r
+ \r
+ @Override\r
+ public void shapeAdded(Graph graph, IGraphicsNode node) {\r
+ // FIXME : this won't work like in previous ProConf\r
+ }\r
+ }\r
+ \r
+ private Map<Resource,PipeRunControlPointQuery> pipeRunQueries = new HashMap<Resource, PipeRunControlPointQuery>();\r
+\r
+ protected ScenegraphQuery newSubnodeListener(G3DNode node) {\r
+ if (node.isInstanceOf(ProcessResource.plant3Dresource.PipeRun)) {\r
+ PipeRunControlPointQuery query = new PipeRunControlPointQuery(node.getResource());\r
+ pipeRunQueries.put(node.getResource(), query);\r
+ node.getGraph().performQuery(query);\r
+ }\r
+ return new NormalScenegraphQuery(node.getResource());\r
+ \r
+ }\r
+ \r
+ @Override\r
+ protected NodePropertyQuery newRootPropertyListener(G3DNode root) {\r
+ // currently Plant does not have any properties.\r
+ return null;\r
+ }\r
+ \r
+ private class TransformationQuery extends NodeTransformationQuery {\r
+ \r
+ public TransformationQuery(Resource res) {\r
+ super(res);\r
+ }\r
+ \r
+ @Override\r
+ public void shapeUpdated(Graph graph, IGraphicsNode shape) {\r
+ //if (shape instanceof IGeometryNode) {\r
+ // updateGeometry((IGeometryNode)shape);\r
+ //} else {\r
+ shape.updateTransform(graph);\r
+ //}\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ protected NodeTransformationQuery newTransformationListener(G3DNode root) {\r
+ return new TransformationQuery(root.getResource());\r
+ }\r
+ \r
+ private class NormalNodePropertyQuery extends org.simantics.proconf.g3d.base.ScenegraphAdapterImpl.NodePropertyQuery {\r
+ \r
+ public NormalNodePropertyQuery(Resource resource) {\r
+ super(resource);\r
+ }\r
+\r
+ @Override\r
+ public void shapeUpdated(Graph graph,IGraphicsNode shape) {\r
+ if (shape instanceof IGeometryNode) {\r
+ updateGeometry((IGeometryNode)shape);\r
+ } else {\r
+ shape.updateTransform(graph);\r
+ }\r
+ }\r
+ }\r
+ @Override\r
+ protected NodePropertyQuery newPropertyListener(G3DNode node) {\r
+ return new NormalNodePropertyQuery(node.getResource());\r
+ }\r
+\r
+ @Override\r
+ protected IGraphicsNode instantiateNode(IGraphicsNode parent,\r
+ G3DNode node) {\r
+ Plant3DResource p3r = ProcessResource.plant3Dresource;\r
+ IGraphicsNode newNode = null;\r
+ try {\r
+ if (node.isInstanceOf(p3r.Equipment)) {\r
+ newNode = new ParameterizedModelNode(\r
+ editor, parent, node.getGraph(),\r
+ node.getResource(), p3r.HasGraphics);\r
+ } else if (node.isInstanceOf(p3r.PipeRun)) {\r
+ newNode = new PipeRunNode(parent, node.getGraph(), node.getResource());\r
+ } else if (node.isInstanceOf(p3r.Nozzle)) {\r
+ newNode = new ParameterizedModelNode(\r
+ editor, parent, node.getGraph(),\r
+ node.getResource(), p3r.HasGraphics);\r
+ // CodedComponent must be handled first since it uses\r
+ // hard-coded geometries\r
+ // TODO : is this really necessary, or could we unify\r
+ // PipeComponentNode, InlineComponentNode,...\r
+ } else if (node.isInstanceOf(p3r.CodedComponent)) {\r
+ newNode = new PipeComponentNode(editor,\r
+ parent, node.getGraph(), node.getResource());\r
+ } else if (node.isInstanceOf(p3r.NonVisibleComponent)) {\r
+ newNode = new NonVisibleNode(parent, node.getGraph(), node.getResource());\r
+ } else if (node.isInstanceOf(p3r.PipelineComponent)) {\r
+ newNode = new PipelineComponentNode(editor,\r
+ parent, node.getGraph(), node.getResource());\r
+ } \r
+\r
+ // } else if (node instanceof Shape) // Markers (ar/mobile)\r
+ // needed this\r
+ // newNode = new ShapeNode(TestProcessEditor.this,parent,node);\r
+ if (newNode != null) {\r
+ if (newNode instanceof ISelectableNode)\r
+ ((ISelectableNode) newNode).setVisible(true);\r
+ if (newNode instanceof IGeometryNode) {\r
+ updateGeometry((IGeometryNode) newNode);\r
+ }\r
+ return newNode;\r
+ }\r
+ } catch (Exception e) {\r
+ ErrorLogger.defaultLogError("Cannot handle node " + node.getResource(), e);\r
+ return null;\r
+ }\r
+ ErrorLogger.defaultLogError("Cannot handle node " + node.getResource(), null);\r
+ return null;\r
+\r
+ }\r
+\r
+ /**\r
+ * This is used to create elbows and straight pipes to pipeline TODO :\r
+ * this should be done with rule-engine!\r
+ * \r
+ * \r
+ * @author Marko Luukkainen\r
+ * \r
+ */\r
+ protected class PipeRunControlPointQuery extends NodeQuery {\r
+ private List<Resource> removed = new ArrayList<Resource>();\r
+ private List<Resource> added = new ArrayList<Resource>();\r
+\r
+ public PipeRunControlPointQuery(Resource r) {\r
+ super(r);\r
+ if (DEBUG) System.out.println("Created PipeRunControlPointQuery for " + r);\r
+\r
+ }\r
+\r
+ @Override\r
+ protected Object compute2(Graph graph) {\r
+ PipeRun run = new PipeRun(graph, nodeResource);\r
+ Collection<IEntity> cps = run\r
+ .getRelatedObjects(ProcessResource.plant3Dresource.HasControlPoints);\r
+ List<Resource> res = new ArrayList<Resource>();\r
+ for (IEntity t : cps)\r
+ res.add(t.getResource());\r
+ return res;\r
+ }\r
+\r
+ @Override\r
+ public boolean updated(Graph graph, Object oldResult,\r
+ Object newResult) {\r
+ \r
+ removed.clear();\r
+ added.clear();\r
+\r
+ List<Resource> oldCps = (List<Resource>) oldResult;\r
+ List<Resource> newCps = (List<Resource>) newResult;\r
+ if (oldCps == null)\r
+ oldCps = new ArrayList<Resource>();\r
+\r
+ for (Resource r : oldCps) {\r
+ if (!newCps.contains(r))\r
+ removed.add(r);\r
+ }\r
+\r
+ for (Resource r : newCps) {\r
+ if (!oldCps.contains(r))\r
+ added.add(r);\r
+ }\r
+ for (Resource r : removed)\r
+ removeControlPoint(graph, r);\r
+ for (Resource r : added) {\r
+ addControlPoint(graph, r);\r
+ // ControlPointTools.addControlPoint(new\r
+ // PipeRun(graph,pipeRun), new PipeControlPoint(graph, r));\r
+ }\r
+\r
+ return (added.size() > 0 || removed.size() > 0);\r
+ }\r
+ \r
+ @Override\r
+ public void dispose() {\r
+ super.dispose();\r
+ for (ControlPointPropertyQuery q : controlPointPropertyQueries.values())\r
+ q.dispose();\r
+ controlPointPropertyQueries.clear();\r
+ }\r
+ \r
+ private Map<Resource,ControlPointPropertyQuery> controlPointPropertyQueries = new HashMap<Resource, ControlPointPropertyQuery>();\r
+ \r
+ private void addControlPoint(Graph graph, Resource resource) {\r
+ ControlPointPropertyQuery query = new ControlPointPropertyQuery(resource);\r
+ graph.performQuery(query);\r
+ controlPointPropertyQueries.put(resource,query);\r
+ }\r
+ \r
+ private void removeControlPoint(Graph graph, Resource resource) {\r
+ ControlPointPropertyQuery query = controlPointPropertyQueries.remove(resource);\r
+ query.dispose();\r
+ ControlPointTools.removeControlPoint(new PipeControlPoint(\r
+ graph, resource));\r
+ }\r
+\r
+ }\r
+\r
+ protected class ControlPointPropertyQuery extends NodeQuery {\r
+ boolean initialized = false;\r
+ \r
+ public ControlPointPropertyQuery(Resource r) {\r
+ super(r);\r
+ if (DEBUG) System.out.println("Created ControlPointPropertyQuery for " + r);\r
+ }\r
+ \r
+ @Override\r
+ public List<Object> compute2(Graph g) {\r
+ IEntity t = EntityFactory.create(g,nodeResource);\r
+ \r
+ Collection<Property> properties = t.getRelatedProperties(ProcessResource.builtins.HasProperty);\r
+ List<Object> propertyValues = new ArrayList<Object>();\r
+ p(properties,propertyValues);\r
+\r
+ return propertyValues;\r
+ }\r
+ \r
+ private void p(Collection<Property> properties, List<Object> propertyValues) {\r
+ for (Property p : properties) {\r
+ Collection<Property> subProperties = p.getRelatedProperties(p.getGraph().getBuiltins().HasProperty);\r
+ if (subProperties.size() != 0) {\r
+ p(subProperties,propertyValues);\r
+ } \r
+ if (p.hasValue()){\r
+ propertyValues.add(p.getValue());\r
+ }\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public boolean updated(Graph graph, Object oldResult, Object newResult) {\r
+ PipingRules.pipeControlPointPositionUpdate(graph, this.nodeResource);\r
+ if (initialized) {\r
+ //PipingRules.pipeControlPointPositionUpdate(graph, this.nodeResource);\r
+ } else {\r
+ initialized = true;\r
+ }\r
+ return true;\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ protected void removeNode(Resource parent, Resource r) {\r
+ super.removeNode(parent, r);\r
+ PipeRunControlPointQuery q = pipeRunQueries.get(r);\r
+ if (q != null)\r
+ q.dispose();\r
+ }\r
+ \r
+ @Override\r
+ public void dispose() {\r
+ super.dispose();\r
+ }\r
+\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.adapters;\r
+\r
+import java.util.List;\r
+\r
+import org.simantics.proconf.g3d.base.ScenegraphAdapter;\r
+import org.simantics.proconf.g3d.base.SelectionAdapter;\r
+import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
+import org.simantics.proconf.g3d.scenegraph.ISelectableNode;\r
+\r
+public class ProcessEditorSelectionAdapter extends SelectionAdapter {\r
+ \r
+ \r
+ public ProcessEditorSelectionAdapter(ScenegraphAdapter adapter) {\r
+ super(adapter);\r
+ }\r
+\r
+ @Override\r
+ public void setEditorSelection() {\r
+ List<IGraphicsNode> sel = getSelectedObjects();\r
+ for (IGraphicsNode o : adapter.getNodes())\r
+ if (o instanceof ISelectableNode) {\r
+ if (sel.contains(o)) {\r
+ ((ISelectableNode)o).setSelected(true);\r
+ } else {\r
+ ((ISelectableNode)o).setSelected(false);\r
+ }\r
+ }\r
+ }\r
+\r
+\r
+ @Override\r
+ protected void setEditorHighlightSelection() {\r
+ List<IGraphicsNode> sel = getInteractiveSelectedObjects();\r
+ for (IGraphicsNode o : adapter.getNodes())\r
+ if (o instanceof ISelectableNode) {\r
+ if (sel.contains(o)) {\r
+ ((ISelectableNode)o).setHighlighted(true);\r
+ } else {\r
+ ((ISelectableNode)o).setHighlighted(false);\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
-package fi.vtt.simantics.processeditor.adapters;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.adapters;\r
\r
import javax.vecmath.Point3d;\r
import javax.vecmath.Vector3d;\r
import org.simantics.db.adaption.ResourceAdapter;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.actions.PositionType;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipingTools2.Direction;\r
import org.simantics.proconf.g3d.base.Constraint;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.actions.PositionType;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2.Direction;\r
\r
public class TurnComponentConstraintAdapter implements ResourceAdapter {\r
@SuppressWarnings("unchecked")\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.animations;\r
+package org.simantics.processeditor.animations;\r
\r
import java.net.URL;\r
import java.util.ArrayList;\r
import org.eclipse.core.runtime.Path;\r
import org.simantics.db.Graph;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
+import org.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
import org.simantics.proconf.g3d.animation.Animatable;\r
import org.simantics.proconf.g3d.animation.AnimationController;\r
import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
import com.jme.util.TextureManager;\r
import com.jmex.effects.particles.ParticleGeometry;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
\r
\r
public class PipeAnimationController implements AnimationController {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.animations;\r
+package org.simantics.processeditor.animations;\r
\r
import java.util.List;\r
\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
import org.simantics.proconf.g3d.animation.Animatable;\r
-import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.VecmathJmeTools;\r
\r
import com.jme.renderer.ColorRGBA;\r
import com.jmex.effects.particles.ParticleGeometry;\r
\r
\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.VariableLengthInlineComponent;\r
\r
\r
public class PipeFlowAnimation implements Animatable{ \r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.animations;\r
+package org.simantics.processeditor.animations;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
\r
import com.jme.renderer.ColorRGBA;\r
\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
\r
// TODO : this class won't work with valueSets\r
public class ResourcePipeAnimationController extends PipeAnimationController {\r
-package fi.vtt.simantics.processeditor.common;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.common;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.actions.PositionType;\r
+import org.simantics.processeditor.common.PipingTools2.Direction;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.MathTools;\r
import org.simantics.proconf.g3d.base.TransformationTools;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
import org.simantics.utils.datastructures.Pair;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.actions.PositionType;\r
-import fi.vtt.simantics.processeditor.common.PipingTools2.Direction;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
\r
public class ControlPointTools {\r
\r
}\r
\r
static boolean isControlPointChanged(PipeControlPoint node) {\r
+\r
long id = node.getResource().getResourceId();\r
+ \r
boolean changed = updatePosition(node);\r
//if (!changed) {\r
if (node.isInstanceOf(ProcessResource.plant3Dresource.PathLegEndControlPoint)) {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.common;\r
+package org.simantics.processeditor.common;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.common;\r
+package org.simantics.processeditor.common;\r
\r
import java.nio.FloatBuffer;\r
import java.nio.IntBuffer;\r
import javax.vecmath.Vector3d;\r
\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
+import org.simantics.processeditor.stubs.TurnControlPoint;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.GeometryProvider;\r
import org.simantics.proconf.g3d.base.MathTools;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.scene.Geometry;\r
import com.jme.scene.Line;\r
import com.jme.scene.TriMesh;\r
import com.jme.util.geom.BufferUtils;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.TurnControlPoint;\r
\r
\r
/**\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.common;\r
+package org.simantics.processeditor.common;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.MathTools;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
\r
/**\r
* Rules that update pipeline.\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.common;\r
+package org.simantics.processeditor.common;\r
\r
\r
public class PipingTools {\r
-package fi.vtt.simantics.processeditor.common;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.common;\r
\r
import java.util.Collection;\r
\r
import org.simantics.layer0.utils.Statement;\r
import org.simantics.layer0.utils.instantiation.Instance;\r
import org.simantics.layer0.utils.instantiation.InstanceFactory;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.actions.PositionType;\r
+import org.simantics.processeditor.stubs.Equipment;\r
+import org.simantics.processeditor.stubs.InlineComponent;\r
+import org.simantics.processeditor.stubs.Nozzle;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.actions.PositionType;\r
-import fi.vtt.simantics.processeditor.stubs.Equipment;\r
-import fi.vtt.simantics.processeditor.stubs.InlineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.Nozzle;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
\r
public class PipingTools2 {\r
private static final boolean DEBUG = false;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
-import org.simantics.g2d.stubs.anim.Animation;\r
+import org.simantics.animation.stubs.Animation;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.viewpoints.TraversalPath;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PathUtils;\r
import org.simantics.proconf.browsing.GraphExplorer;\r
import org.simantics.proconf.g3d.animation.Animatable;\r
import org.simantics.proconf.g3d.animation.AnimationSystem;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.tools.OEPathSelectionListener;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PathUtils;\r
\r
public class ConfigureAnimationDialog extends Dialog {\r
Session session;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.viewpoints.TraversalPath;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PathUtils;\r
+import org.simantics.processeditor.monitors.PathContainer;\r
import org.simantics.proconf.browsing.GraphExplorer;\r
import org.simantics.proconf.g3d.stubs.G3DModel;\r
import org.simantics.proconf.g3d.tools.OEPathSelectionListener;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PathUtils;\r
-import fi.vtt.simantics.processeditor.monitors.PathContainer;\r
\r
public class ConfigureMonitorDialog extends Dialog {\r
Session session;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import java.util.ArrayList;\r
import java.util.List;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.viewpoints.TraversalPath;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.animations.ResourcePipeAnimationController;\r
+import org.simantics.processeditor.common.PathUtils;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
import org.simantics.proconf.browsing.GraphExplorer;\r
import org.simantics.proconf.g3d.animation.AnimationSystem;\r
import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
import org.simantics.proconf.g3d.tools.OEPathSelectionListener;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.animations.ResourcePipeAnimationController;\r
-import fi.vtt.simantics.processeditor.common.PathUtils;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
\r
\r
public class ConfigurePipelineAnimationDialog extends Dialog {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import org.eclipse.swt.widgets.Shell;\r
import org.simantics.db.Session;\r
+import org.simantics.processeditor.ProcessResource;\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class EquipmentDialog extends LibraryComponentDialog {\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.dialogs;\r
+\r
+import org.eclipse.jface.dialogs.Dialog;\r
+import org.eclipse.jface.dialogs.IDialogConstants;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.KeyEvent;\r
+import org.eclipse.swt.events.KeyListener;\r
+import org.eclipse.swt.events.SelectionEvent;\r
+import org.eclipse.swt.events.SelectionListener;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.widgets.Button;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.eclipse.swt.widgets.Text;\r
+\r
+public class FloorConfigureDialog extends Dialog implements KeyListener,SelectionListener {\r
+ \r
+ private boolean floorEnabled = true;\r
+ private double floorHeight = 0.0;\r
+ \r
+ private Text floorHeightText = null;\r
+ private Button floorEnabledButton = null;\r
+ \r
+ public FloorConfigureDialog(Shell shell) {\r
+ super(shell);\r
+ }\r
+ \r
+ @Override\r
+ protected Control createDialogArea(Composite parent) {\r
+ Composite composite = (Composite) super.createDialogArea(parent);\r
+ Label label = new Label(composite, SWT.WRAP);\r
+ label.setText("Configure floor");\r
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL\r
+ | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL\r
+ | GridData.VERTICAL_ALIGN_CENTER);\r
+ \r
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);\r
+ label.setLayoutData(data);\r
+ label.setFont(parent.getFont());\r
+ floorEnabledButton = new Button(composite,SWT.CHECK);\r
+ floorEnabledButton.setText("Enabled");\r
+ label = new Label(composite, SWT.WRAP);\r
+ label.setText("Height");\r
+ label.setLayoutData(data);\r
+ label.setFont(parent.getFont());\r
+ floorHeightText = new Text(composite,SWT.NONE);\r
+ \r
+ \r
+ floorHeightText.addKeyListener(this);\r
+ floorEnabledButton.addSelectionListener(this);\r
+ floorEnabledButton.setSelection(floorEnabled);\r
+ floorHeightText.setText(Double.toString(floorHeight));\r
+ \r
+ return composite;\r
+ }\r
+ \r
+ @Override\r
+ protected void configureShell(Shell newShell) {\r
+ super.configureShell(newShell);\r
+ newShell.setText("Configure floor");\r
+ }\r
+ \r
+ public void keyPressed(KeyEvent e) {\r
+ \r
+ }\r
+ \r
+ public void keyReleased(KeyEvent e) {\r
+ boolean ok = true;\r
+ try {\r
+ floorHeight = Double.parseDouble(floorHeightText.getText()); \r
+ } catch (NumberFormatException err) {\r
+ ok = false;\r
+ }\r
+ if (ok) {\r
+ this.getButton(IDialogConstants.OK_ID).setEnabled(true);\r
+ } else {\r
+ this.getButton(IDialogConstants.OK_ID).setEnabled(false);\r
+ }\r
+ }\r
+ \r
+ public void widgetDefaultSelected(SelectionEvent e) {\r
+ \r
+ }\r
+ \r
+ public void widgetSelected(SelectionEvent e) {\r
+ floorEnabled = floorEnabledButton.getSelection();\r
+ }\r
+\r
+ public boolean isFloorEnabled() {\r
+ return floorEnabled;\r
+ }\r
+\r
+ public double getFloorHeight() {\r
+ return floorHeight;\r
+ }\r
+\r
+}\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.dialogs;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.db.Session;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.ui.ProConfUI;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class LibraryComponentDialog extends Dialog{ \r
\r
public void run() {\r
getShell().setText(title);\r
if (selectedType == null) {\r
- typeList.select(0);\r
- selectedType = (Resource)typeList.getData(typeList.getItem(0));\r
+ if (typeList.getItemCount() > 0) {\r
+ typeList.select(0);\r
+ selectedType = (Resource)typeList.getData(typeList.getItem(0));\r
+ }\r
}\r
}\r
\r
Resource projectResource = ProConfUI.getProject().getResource();\r
Stack<Resource> handling = new Stack<Resource>();\r
handling.push(projectResource);\r
+ \r
+ // this is just a hack to get equipment defined in ontologies\r
+ Resource projectsLib = g.getObjects(projectResource, g.getBuiltins().PartOf).iterator().next();\r
+ Collection<Resource> projects = g.getObjects(projectsLib, g.getBuiltins().ConsistsOf);\r
+ Resource typeSystemProject = null;\r
+ for (Resource project : projects) {\r
+ IEntity ent = EntityFactory.create(g,project);\r
+ String name = ent.getName();\r
+ if(name.equals("Type System Project")) {\r
+ typeSystemProject = project;\r
+ break;\r
+ }\r
+ }\r
+ Collection<Resource> ontologies = g.getObjects(typeSystemProject, g.getBuiltins().ConsistsOf);\r
+ for (Resource ontology : ontologies) {\r
+ if(g.isInstanceOf(ontology, g.getBuiltins().Ontology))\r
+ handling.add(ontology);\r
+ }\r
+ \r
while (!handling.isEmpty()) {\r
final Resource node = handling.pop();\r
if (g.isInstanceOf(node,primaryType)) {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import org.eclipse.swt.widgets.Shell;\r
import org.simantics.db.Session;\r
+import org.simantics.processeditor.ProcessResource;\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class NozzleDialog extends LibraryComponentDialog {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import java.util.Collection;\r
\r
import org.eclipse.swt.widgets.Shell;\r
import org.simantics.db.Resource;\r
import org.simantics.db.Session;\r
+import org.simantics.processeditor.ProcessResource;\r
\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class PipelineComponentDialog extends LibraryComponentDialog{\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.dialogs;\r
+package org.simantics.processeditor.dialogs;\r
\r
import org.eclipse.jface.dialogs.Dialog;\r
import org.eclipse.jface.dialogs.IDialogConstants;\r
-package fi.vtt.simantics.processeditor.gizmo;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.gizmo;\r
\r
import java.net.URL;\r
import java.util.ArrayList;\r
\r
import org.eclipse.core.runtime.FileLocator;\r
import org.eclipse.core.runtime.Path;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.actions.PositionType;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.base.VecmathJmeTools;\r
import org.simantics.proconf.g3d.gizmo.Gizmo;\r
import com.jme.scene.state.ZBufferState;\r
import com.jme.util.TextureManager;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.actions.PositionType;\r
\r
/**\r
* Gizmo that allows user to selected insertion point of a component\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.ui.workbench.ResourceEditorInput;\r
import org.simantics.proconf.ui.workbench.editor.SimpleEditorAdapter;\r
import org.simantics.utils.ui.BundleUtils;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
/**\r
* EditorAdapter for EquipmentEditor\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import java.util.ArrayList;\r
import java.util.HashMap;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.instantiation.InstanceFactory;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.ui.ProConfUI;\r
import org.simantics.proconf.ui.utils.ResourceAdaptionUtils;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
\r
/**\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import org.eclipse.core.commands.AbstractHandler;\r
import org.eclipse.core.commands.ExecutionEvent;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.instantiation.InstanceFactory;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.Equipment;\r
import org.simantics.proconf.ui.ProConfUI;\r
import org.simantics.proconf.ui.utils.ResourceAdaptionUtils;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.Equipment;\r
\r
/**\r
* Creates new equipment\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import org.eclipse.core.commands.AbstractHandler;\r
import org.eclipse.core.commands.ExecutionEvent;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.stubs.Library;\r
+import org.simantics.processeditor.stubs.Plant;\r
import org.simantics.proconf.ui.ProConfUI;\r
import org.simantics.proconf.ui.utils.ResourceAdaptionUtils;\r
\r
-import fi.vtt.simantics.processeditor.stubs.Plant;\r
\r
public class NewPlantHandler extends AbstractHandler {\r
\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.ui.workbench.ResourceEditorInput;\r
import org.simantics.proconf.ui.workbench.editor.SimpleEditorAdapter;\r
import org.simantics.utils.ui.BundleUtils;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
/**\r
* EditorAdapter for PipeLineComponentEditor\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.ui.workbench.ResourceEditorInput;\r
import org.simantics.proconf.ui.workbench.editor.SimpleEditorAdapter;\r
import org.simantics.utils.ui.BundleUtils;\r
import org.simantics.utils.ui.workbench.WorkbenchUtils;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class Plant3DEditorAdapter extends SimpleEditorAdapter {\r
public Plant3DEditorAdapter() {\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
+\r
+import org.simantics.db.Graph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.adaption.AdaptionException;\r
+import org.simantics.db.adaption.ResourceAdapter;\r
+\r
+public class Plant3DProjectAdapter implements ResourceAdapter {\r
+ @SuppressWarnings("unchecked")\r
+ @Override\r
+ public <T> T adapt(Graph graph, Resource resource, Resource mia) throws AdaptionException {\r
+ return (T) new Plant3DProjectType(graph,resource);\r
+ }\r
+}\r
-package fi.vtt.simantics.processeditor.handlers;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.handlers;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.awt.Color;\r
import java.util.ArrayList;\r
import javax.vecmath.Vector3d;\r
\r
import org.simantics.db.Graph;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.InlineComponent;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.base.VecmathJmeTools;\r
import com.jmex.awt.swingui.ImageGraphics;\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.InlineComponent;\r
\r
\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.util.ArrayList;\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.ResourceDebugUtils;\r
+import org.simantics.processeditor.ProcessResource;\r
\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
\r
public class ObjectPropertyProvider implements MonitorTextProvider {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.util.Collection;\r
import java.util.List;\r
* FIXME : singleton\r
* TODO : removing paths\r
* TODO : prevent adding same path multiple times\r
+ * TODO : how to handle multi-instances?\r
* \r
* \r
* @author Marko Luukkainen\r
private static PathContainer instance = new PathContainer();\r
\r
MapList<Resource, List<Resource>> paths;\r
+ //List<Pair<List<Resource>,List<Resource>>> multiInstancePaths;\r
\r
private PathContainer() {\r
paths = new MapList<Resource, List<Resource>>();\r
+ //multiInstancePaths = new ArrayList<Pair<List<Resource>,List<Resource>>>();\r
}\r
\r
public List<List<Resource>> getPaths(IEntity instance) {\r
Collection<IEntity> types = instance.getTypes();\r
- if (types.size() != 1)\r
- throw new UnsupportedOperationException("Multi-instances not supported!");\r
- Resource type = types.iterator().next().getResource();\r
- return paths.getValues(type);\r
+ if (types.size() != 1) {\r
+ // for multi-instances we check if any of the types have paths\r
+ // no we return paths for a single type (it is possible to combine paths for all types)\r
+ for (IEntity type : types) {\r
+ Resource r = type.getResource();\r
+ List<List<Resource>> path = paths.getValues(r);\r
+ if (path != null)\r
+ return path;\r
+ }\r
+ return null;\r
+ } else {\r
+ Resource type = types.iterator().next().getResource();\r
+ return paths.getValues(type);\r
+ }\r
}\r
\r
public void addPath(Resource type, List<Resource> path) {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
import org.simantics.layer0.utils.ResourceDebugUtils;\r
+import org.simantics.processeditor.common.PathUtils;\r
\r
-import fi.vtt.simantics.processeditor.common.PathUtils;\r
\r
\r
public class ResourcePathPropertyProvider implements MonitorTextProvider {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.monitors;\r
+package org.simantics.processeditor.monitors;\r
\r
import java.net.URL;\r
import java.util.ArrayList;\r
import org.eclipse.core.runtime.Path;\r
import org.eclipse.swt.graphics.Rectangle;\r
import org.simantics.db.Graph;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.stubs.InlineComponent;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.MathTools;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import com.jme.scene.state.TextureState;\r
import com.jme.util.TextureManager;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.stubs.InlineComponent;\r
\r
/**\r
* A monitor implemetation that uses JME's text component to show it's information. \r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.perspectives;\r
+\r
+import org.eclipse.ui.IPageLayout;\r
+import org.eclipse.ui.IPerspectiveFactory;\r
+\r
+public class Plant3DModellingPerspective implements IPerspectiveFactory{\r
+ \r
+ @Override\r
+ public void createInitialLayout(IPageLayout layout) {\r
+ \r
+ }\r
+\r
+}\r
-package fi.vtt.simantics.processeditor.perspectives;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.perspectives;\r
\r
import java.util.Collection;\r
\r
import org.simantics.layer0.utils.viewpoints.TraversalDecision;\r
import org.simantics.layer0.utils.viewpoints.TraversalRule;\r
import org.simantics.layer0.utils.viewpoints.rules.AcceptAllResourceAcceptRule;\r
+import org.simantics.processeditor.ProcessResource;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class ViewpointGenerator {\r
public static ResourceViewpoint createViewpoint() {\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.scenegraph;\r
+package org.simantics.processeditor.scenegraph;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.scenegraph.NonTransformableNode;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class NonVisibleNode extends NonTransformableNode {\r
\r
-package fi.vtt.simantics.processeditor.scenegraph;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.scenegraph;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.common.PipingTools;\r
+import org.simantics.processeditor.stubs.CodedComponent;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.Plant3DResource;\r
+import org.simantics.processeditor.stubs.SizeChangeControlPoint;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.scenegraph.ShapeNode;\r
import com.jme.scene.state.MaterialState;\r
import com.jme.scene.state.RenderState;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.common.PipingTools;\r
-import fi.vtt.simantics.processeditor.stubs.CodedComponent;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.Plant3DResource;\r
-import fi.vtt.simantics.processeditor.stubs.SizeChangeControlPoint;\r
\r
\r
/**\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.scenegraph;\r
+package org.simantics.processeditor.scenegraph;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.scenegraph.NonTransformableNode;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class PipeRunNode extends NonTransformableNode {\r
\r
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.scenegraph;\r
+package org.simantics.processeditor.scenegraph;\r
\r
import javax.vecmath.AxisAngle4d;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
+import org.simantics.processeditor.stubs.PipelineComponent;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.scenegraph.ParameterizedModelNode;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipelineComponent;\r
\r
\r
\r
-package fi.vtt.simantics.processeditor.tools;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.tools;\r
\r
import java.io.ByteArrayInputStream;\r
import java.io.ByteArrayOutputStream;\r
import org.simantics.db.GraphRequestAdapter;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.common.PipeComponentProvider;\r
+import org.simantics.processeditor.stubs.DirectedControlPoint;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
import org.simantics.proconf.g3d.actions.ContextAction;\r
import org.simantics.proconf.g3d.base.EditorContribution;\r
import org.simantics.proconf.g3d.base.G3DTools;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.base.VecmathJmeTools;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
-import org.simantics.utils.ErrorLogger;\r
+import org.simantics.utils.ui.ErrorLogger;\r
\r
import com.jme.renderer.ColorRGBA;\r
import com.jme.scene.Geometry;\r
import com.jme.util.export.binary.BinaryImporter;\r
import com.jmex.model.converters.ObjToJme;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.common.PipeComponentProvider;\r
-import fi.vtt.simantics.processeditor.stubs.DirectedControlPoint;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
\r
public class ControlPointContribution implements EditorContribution {\r
private List<ContextAction> actions = new ArrayList<ContextAction>();\r
-package fi.vtt.simantics.processeditor.tools;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.tools;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.eclipse.swt.widgets.Text;\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.ProcessResource;\r
import org.simantics.proconf.g3d.actions.ContextAction;\r
import org.simantics.proconf.g3d.base.EditorContribution;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
\r
public class NozzleContribution implements EditorContribution {\r
private List<ContextAction> actions = new ArrayList<ContextAction>();\r
-package fi.vtt.simantics.processeditor.tools;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.tools;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.db.Resource;\r
import org.simantics.layer0.utils.EntityFactory;\r
import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.actions.InsertComponentAction;\r
+import org.simantics.processeditor.actions.InsertEquipmentAction;\r
+import org.simantics.processeditor.actions.InsertNozzleAction;\r
+import org.simantics.processeditor.actions.ReversePipelineAction;\r
+import org.simantics.processeditor.actions.RoutePipeAction;\r
+import org.simantics.processeditor.actions.TranslateElbowAction;\r
+import org.simantics.processeditor.actions.TranslateInlineComponentAction;\r
+import org.simantics.processeditor.actions.TranslateStraightAction;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.InlineComponent;\r
+import org.simantics.processeditor.stubs.PipeControlPoint;\r
import org.simantics.proconf.g3d.actions.ContextAction;\r
import org.simantics.proconf.g3d.actions.FocusAction;\r
import org.simantics.proconf.g3d.actions.RemoveAction;\r
import org.simantics.proconf.g3d.actions.RotateAction;\r
import org.simantics.proconf.g3d.actions.TranslateAction;\r
import org.simantics.proconf.g3d.base.EditorContribution;\r
+import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
import org.simantics.utils.ui.jface.MenuTools;\r
\r
import com.jme.scene.Node;\r
import com.jme.scene.Spatial;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.actions.InsertComponentAction;\r
-import fi.vtt.simantics.processeditor.actions.InsertEquipmentAction;\r
-import fi.vtt.simantics.processeditor.actions.InsertNozzleAction;\r
-import fi.vtt.simantics.processeditor.actions.ReversePipelineAction;\r
-import fi.vtt.simantics.processeditor.actions.RoutePipeAction;\r
-import fi.vtt.simantics.processeditor.actions.TranslateElbowAction;\r
-import fi.vtt.simantics.processeditor.actions.TranslateInlineComponentAction;\r
-import fi.vtt.simantics.processeditor.actions.TranslateStraightAction;\r
-import fi.vtt.simantics.processeditor.common.ControlPointTools;\r
-import fi.vtt.simantics.processeditor.stubs.InlineComponent;\r
-import fi.vtt.simantics.processeditor.stubs.PipeControlPoint;\r
-import fi.vtt.simantics.processeditor.views.ProcessEditor;\r
\r
public class PlantEditContribution implements EditorContribution {\r
private List<ContextAction> actions = new ArrayList<ContextAction>();\r
- private ProcessEditor parent;\r
+ private ThreeDimensionalEditorBase parent;\r
private Composite infoComposite;\r
private Text infoText;\r
\r
private Action checkInterferencesAction = null;\r
\r
- public PlantEditContribution(ProcessEditor parent) {\r
+ public PlantEditContribution(ThreeDimensionalEditorBase parent) {\r
this.parent = parent;\r
}\r
\r
-package fi.vtt.simantics.processeditor.tools;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.tools;\r
\r
import java.util.ArrayList;\r
import java.util.Collection;\r
import org.simantics.db.GraphRequestAdapter;\r
import org.simantics.db.GraphRequestStatus;\r
import org.simantics.db.Resource;\r
+import org.simantics.processeditor.Activator;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.animations.PipeAnimationController;\r
+import org.simantics.processeditor.dialogs.ConfigureAnimationDialog;\r
+import org.simantics.processeditor.dialogs.ConfigureMonitorDialog;\r
+import org.simantics.processeditor.dialogs.ConfigurePipelineAnimationDialog;\r
+import org.simantics.processeditor.monitors.Monitor;\r
+import org.simantics.processeditor.monitors.ResourcePathPropertyProvider;\r
+import org.simantics.processeditor.monitors.TextMonitor;\r
+import org.simantics.processeditor.stubs.PipeRun;\r
import org.simantics.proconf.g3d.actions.ContextAction;\r
import org.simantics.proconf.g3d.actions.FocusAction;\r
import org.simantics.proconf.g3d.animation.Animatable;\r
import org.simantics.proconf.g3d.animation.TestAnimationController;\r
import org.simantics.proconf.g3d.animation.ui.AnimationControlCreator;\r
import org.simantics.proconf.g3d.base.EditorContribution;\r
+import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
import org.simantics.proconf.g3d.stubs.G3DNode;\r
import org.simantics.utils.ui.jface.MenuTools;\r
\r
-import fi.vtt.simantics.processeditor.Activator;\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.animations.PipeAnimationController;\r
-import fi.vtt.simantics.processeditor.dialogs.ConfigureAnimationDialog;\r
-import fi.vtt.simantics.processeditor.dialogs.ConfigureMonitorDialog;\r
-import fi.vtt.simantics.processeditor.dialogs.ConfigurePipelineAnimationDialog;\r
-import fi.vtt.simantics.processeditor.monitors.Monitor;\r
-import fi.vtt.simantics.processeditor.monitors.ResourcePathPropertyProvider;\r
-import fi.vtt.simantics.processeditor.monitors.TextMonitor;\r
-import fi.vtt.simantics.processeditor.stubs.PipeRun;\r
-import fi.vtt.simantics.processeditor.views.ProcessEditor;\r
-\r
+/**\r
+ * Plant Visualization Contribution\r
+ * \r
+ * @author Marko Luukkainen <marko.luukkainen@vtt.fi>\r
+ *\r
+ */\r
public class PlantVisualizationContribution implements EditorContribution {\r
private List<ContextAction> actions = new ArrayList<ContextAction>();\r
- private ProcessEditor parent;\r
+ private ThreeDimensionalEditorBase parent;\r
\r
private AnimationSystem animationSystem = null;\r
private Action animatePipesAction = null;\r
\r
private Monitor monitor;\r
\r
- public PlantVisualizationContribution(ProcessEditor parent) {\r
+ public PlantVisualizationContribution(ThreeDimensionalEditorBase parent) {\r
this.parent = parent;\r
}\r
\r
\r
}\r
\r
+ private G3DNode getRoot(Graph g) {\r
+ return new G3DNode(g,parent.getScenegraphAdapter().getRootResource());\r
+ }\r
+ \r
@Override\r
public void initialize(Graph graph) {\r
animateAction = new Action("", Action.AS_CHECK_BOX) {\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
Stack<G3DNode> stack = new Stack<G3DNode>();\r
- stack.add(parent.getPlant(g).toG3DNode());\r
+ stack.add(getRoot(g));\r
while (!stack.isEmpty()) {\r
G3DNode n = stack.pop();\r
list.add(n.getResource());\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
Stack<G3DNode> stack = new Stack<G3DNode>();\r
- stack.add(parent.getPlant(g).toG3DNode());\r
+ stack.add(getRoot(g));\r
while (!stack.isEmpty()) {\r
G3DNode n = stack.pop();\r
if (n.isInstanceOf(ProcessResource.plant3Dresource.PipeRun))\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
Stack<G3DNode> stack = new Stack<G3DNode>();\r
- stack.add(parent.getPlant(g).toG3DNode());\r
+ stack.add(getRoot(g));\r
while (!stack.isEmpty()) {\r
G3DNode n = stack.pop();\r
list.add(n.getResource());\r
@Override\r
public GraphRequestStatus perform(Graph g) throws Exception {\r
Stack<G3DNode> stack = new Stack<G3DNode>();\r
- stack.add(parent.getPlant(g).toG3DNode());\r
+ stack.add(getRoot(g));\r
while (!stack.isEmpty()) {\r
G3DNode n = stack.pop();\r
if (n.isInstanceOf(ProcessResource.plant3Dresource.PipeRun))\r
-package fi.vtt.simantics.processeditor.views;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.views;\r
\r
import java.util.Collection;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.tools.NozzleContribution;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorPart;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.tools.NozzleContribution;\r
\r
public class EquipmentEditorPart extends ThreeDimensionalEditorPart {\r
\r
-package fi.vtt.simantics.processeditor.views;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.views;\r
\r
import java.util.Collection;\r
\r
import org.simantics.db.Graph;\r
import org.simantics.db.Resource;\r
import org.simantics.db.management.ISessionContext;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.tools.ControlPointContribution;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorPart;\r
import org.simantics.proconf.g3d.shapeeditor.views.ShapeEditorBase;\r
\r
-import fi.vtt.simantics.processeditor.ProcessResource;\r
-import fi.vtt.simantics.processeditor.tools.ControlPointContribution;\r
\r
public class PipelineComponentEditorPart extends ThreeDimensionalEditorPart {\r
\r
-package fi.vtt.simantics.processeditor.views;\r
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.views;\r
\r
import org.eclipse.swt.widgets.Composite;\r
import org.simantics.db.Resource;\r
import org.simantics.db.management.ISessionContext;\r
import org.simantics.layer0.utils.viewpoints.ResourceViewpoint;\r
+import org.simantics.processeditor.perspectives.ViewpointGenerator;\r
import org.simantics.proconf.browsing.views.GraphExplorerOutlinePage;\r
\r
-import fi.vtt.simantics.processeditor.perspectives.ViewpointGenerator;\r
\r
public class PlantStructureOutlinePage extends GraphExplorerOutlinePage {\r
\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.views;\r
+\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.simantics.db.management.ISessionContext;\r
+import org.simantics.layer0.utils.viewpoints.ResourceViewpoint;\r
+import org.simantics.processeditor.perspectives.ViewpointGenerator;\r
+import org.simantics.proconf.browsing.GraphExplorer;\r
+import org.simantics.proconf.browsing.views.GraphExplorerView;\r
+\r
+\r
+public class PlantStructureView extends GraphExplorerView {\r
+\r
+ @Override\r
+ protected GraphExplorer createExplorer(Composite parent) {\r
+ return super.createExplorer(parent);\r
+ }\r
+ \r
+ @Override\r
+ protected ResourceViewpoint getViewpoint(ISessionContext context) {\r
+ return ViewpointGenerator.createViewpoint();\r
+ }\r
+}\r
--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.processeditor.views;\r
+\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.ISelectionChangedListener;\r
+import org.eclipse.jface.viewers.SelectionChangedEvent;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;\r
+import org.simantics.db.Graph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.management.ISessionContext;\r
+import org.simantics.layer0.utils.IEntity;\r
+import org.simantics.processeditor.ProcessResource;\r
+import org.simantics.processeditor.actions.ConfigureFloorAction;\r
+import org.simantics.processeditor.actions.InsertComponentAction;\r
+import org.simantics.processeditor.actions.InsertEquipmentAction;\r
+import org.simantics.processeditor.actions.InsertNozzleAction;\r
+import org.simantics.processeditor.actions.RoutePipeAction;\r
+import org.simantics.processeditor.adapters.ProcessEditorAdapter;\r
+import org.simantics.processeditor.adapters.ProcessEditorSelectionAdapter;\r
+import org.simantics.processeditor.common.ControlPointTools;\r
+import org.simantics.processeditor.stubs.Plant;\r
+import org.simantics.processeditor.tools.PlantEditContribution;\r
+import org.simantics.processeditor.tools.PlantVisualizationContribution;\r
+import org.simantics.proconf.g3d.base.JmeRenderingComponent;\r
+import org.simantics.proconf.g3d.base.ScenegraphAdapter;\r
+import org.simantics.proconf.g3d.base.SelectionAdapter;\r
+import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
+import org.simantics.proconf.g3d.common.StructuredResourceSelection;\r
+import org.simantics.proconf.g3d.shapes.FloorShape;\r
+import org.simantics.proconf.g3d.stubs.G3DNode;\r
+import org.simantics.utils.ui.jface.MenuTools;\r
+\r
+import com.jme.math.Vector3f;\r
+import com.jme.scene.Geometry;\r
+\r
+\r
+public class ProcessEditor extends ThreeDimensionalEditorBase {\r
+ \r
+ private Resource plantResource = null;\r
+ \r
+ private ConfigureFloorAction configureFloorAction = null;\r
+\r
+ private Geometry floorShape = null;\r
+\r
+ public ProcessEditor(ISessionContext session) {\r
+ super(session);\r
+ addEditorContribution(new PlantEditContribution(this));\r
+ addEditorContribution(new PlantVisualizationContribution(this));\r
+ }\r
+ \r
+ public ProcessEditor(ISessionContext session,JmeRenderingComponent component) {\r
+ super(session,component);\r
+ addEditorContribution(new PlantEditContribution(this));\r
+ addEditorContribution(new PlantVisualizationContribution(this));\r
+ }\r
+ \r
+ @Override\r
+ protected ScenegraphAdapter createScenegraphAdapter() {\r
+ return new ProcessEditorAdapter(this,session,getRenderingComponent());\r
+ }\r
+ \r
+ @Override\r
+ public void createControl(Graph graph,Composite parent) {\r
+ super.createControl(graph,parent);\r
+\r
+ floorShape = FloorShape.getShape(getRenderingComponent().getDisplaySystem().getRenderer(), 100.f,0.2f);\r
+ getRenderingComponent().getNoCastRoot().attachChild(floorShape);\r
+ floorShape.setLocalTranslation(new Vector3f(0.f,-0.01f,0.f));\r
+ configureFloorAction.setFloorShape(floorShape);\r
+ }\r
+\r
+ @Override\r
+ protected void makeActions(Graph graph) {\r
+ super.makeActions(graph);\r
+\r
+ //actions.add(new ShowTrendsAction(this));\r
+\r
+ configureFloorAction = new ConfigureFloorAction(this);\r
+\r
+// ContextActionFactory extended[] = ContextActionRegistry.getActions("fi.vtt.proconf.shapeeditor.processeditorview");\r
+// for (ContextActionFactory c : extended) {\r
+// actions.add(c.createAction(this));\r
+// }\r
+ }\r
+ \r
+ protected void fillLocalPullDown() {\r
+ super.fillLocalPullDown();\r
+ MenuTools.getOrCreate(getMenuID(),"Advanced", menuManager).add(configureFloorAction);\r
+ }\r
+ \r
+\r
+ @Override\r
+ protected void pageSelectionChanged(IWorkbenchPart part, ISelection selection) {\r
+ StructuredResourceSelection s = SelectionAdapter.transformSelection(selection);\r
+\r
+ selectionAdapter.setCurrentSelection(s);\r
+ viewChanged = true;\r
+\r
+ /*\r
+ if (part instanceof ProcessEditor) {\r
+ ProcessEditor sender = (ProcessEditor)part;\r
+ if (!sender.getPlantResource().equals(plantResource)) {\r
+ selectionAdapter.setCurrentSelection(new StructuredResourceSelection());\r
+ selectionAdapter.setEditorSelection();\r
+ return;\r
+ }\r
+ } \r
+ */\r
+ \r
+ selectionAdapter.setEditorSelection();\r
+ \r
+ }\r
+\r
+ @Override\r
+ protected void reloadFrom(IEntity thing) {\r
+ if (plantResource != null) {\r
+ throw new UnsupportedOperationException("Reloading instantiated viewer not supported");\r
+ }\r
+ if (thing.isInstanceOf(ProcessResource.plant3Dresource.Plant)) {\r
+ plantResource = thing.getResource();\r
+ G3DNode plant = new G3DNode(thing);\r
+ adapter.setRootNode(plant);\r
+ //adapter.addOutbound(plant);\r
+ ControlPointTools.reloadCache(thing.getGraph(),plant.getResource());\r
+ } else {\r
+ throw new IllegalArgumentException("Resource is not a plant");\r
+ } \r
+ }\r
+\r
+ public Resource getPlantResource() {\r
+ return plantResource;\r
+ }\r
+ \r
+ public Plant getPlant(Graph g) {\r
+ return new Plant(g, plantResource);\r
+ }\r
+ \r
+ @Override\r
+ protected SelectionAdapter createSelectionAdapter() {\r
+ return new ProcessEditorSelectionAdapter(adapter);\r
+ }\r
+\r
+ @Override\r
+ protected void hookDragAndDrop() {\r
+ super.hookDragAndDrop();\r
+ dropTarget.addDropListener(new InsertEquipmentAction(this));\r
+ dropTarget.addDropListener(new InsertNozzleAction(this));\r
+ dropTarget.addDropListener(new InsertComponentAction(this));\r
+ dropTarget.addDropListener(new RoutePipeAction(this));\r
+ }\r
+ \r
+ @Override\r
+ public Object getAdapter(Class adapter) {\r
+ if (adapter == IContentOutlinePage.class) {\r
+ if (getPlantResource() == null)\r
+ return null;\r
+ final PlantStructureOutlinePage page = new PlantStructureOutlinePage(sessionContext,getPlantResource());\r
+ \r
+ getSelectionAdapter().addSelectionChangedListener(new ISelectionChangedListener() {\r
+ @Override\r
+ public void selectionChanged(SelectionChangedEvent event) {\r
+ page.setSelection(event.getSelection());\r
+ \r
+ }\r
+ });\r
+ parent.getDisplay().asyncExec(new Runnable() {\r
+ @Override\r
+ public void run() {\r
+ page.addSelectionChangedListener(new ISelectionChangedListener() {\r
+ @Override\r
+ public void selectionChanged(SelectionChangedEvent event) {\r
+ selectionAdapter.setSelection(SelectionAdapter.transformSelection(event.getSelection()));\r
+ }\r
+ });\r
+ }\r
+ });\r
+\r
+ return page;\r
+ }\r
+ return null;\r
+ }\r
+}
\ No newline at end of file
/*******************************************************************************\r
- * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.\r
+ * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
* which accompanies this distribution, and is available at\r
* Contributors:\r
* VTT Technical Research Centre of Finland - initial API and implementation\r
*******************************************************************************/\r
-package fi.vtt.simantics.processeditor.views;\r
+package org.simantics.processeditor.views;\r
\r
import org.simantics.db.management.ISessionContext;\r
import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r