[x3d-public] X3DJSAIL: Desired chaining methods. Modify return value orprovide new method.

Don Brutzman brutzman at nps.edu
Thu Mar 16 02:08:22 PDT 2017


On 3/15/2017 6:14 PM, Don Brutzman wrote:
> Yes these were deployed with the last release announcement.  Checkable using javadoc:
>
>     http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/HAnim/HAnimHumanoidObject.html#method.summary

... which shows all of the requested append methods present.

> The addChild(X3DChildNode newValue) method is also there from previous work... I will look at adding a variant of addChild for other constructs (X3D statements such as *Proto* etc.) next.

Good news: I think that the deployed implementation actually covers the case you are looking for.

Looking at X3DChildNode shows all of the statements needed (*Proto* ROUTE IMPORT/EXPORT etc.)

http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/sai/Core/X3DChildNode.html

All Known Implementing Classes:
     AnchorObject, AudioClipObject, BackgroundObject, BillboardObject, BooleanFilterObject, BooleanSequencerObject, BooleanToggleObject, BooleanTriggerObject, CADAssemblyObject, CADFaceObject, CADLayerObject, CADPartObject, ClipPlaneObject, CollidableOffsetObject, CollidableShapeObject, CollisionObject, CollisionSensorObject, ColorChaserObject, ColorDamperObject, ColorInterpolatorObject, CommentsBlock, CoordinateChaserObject, CoordinateDamperObject, CoordinateInterpolator2DObject, CoordinateInterpolatorObject, CylinderSensorObject, DirectionalLightObject, DISEntityManagerObject, DISEntityTypeMappingObject, EaseInEaseOutObject, EspduTransformObject, EXPORTObject, ExternProtoDeclareObject, FogObject, GeoLocationObject, GeoLODObject, GeoMetadataObject, GeoPositionInterpolatorObject, GeoProximitySensorObject, GeoTouchSensorObject, GeoTransformObject, GeoViewpointObject, GroupObject, HAnimHumanoidObject, HAnimJointObject, HAnimSegmentObject, HAnimSiteObject, IMPORTObject, InlineObject, IntegerSequencerObject, IntegerTriggerObject, IsoSurfaceVolumeDataObject, KeySensorObject, LayoutGroupObject, LayoutObject, LinePickSensorObject, LoadSensorObject, LocalFogObject, LODObject, MovieTextureObject, NavigationInfoObject, NormalInterpolatorObject, NurbsOrientationInterpolatorObject, NurbsPositionInterpolatorObject, NurbsSetObject, NurbsSurfaceInterpolatorObject, OrientationChaserObject, OrientationDamperObject, OrientationInterpolatorObject, OrthoViewpointObject, ParticleSystemObject, PickableGroupObject, PlaneSensorObject, PointLightObject, PointPickSensorObject, PositionChaser2DObject, PositionChaserObject, PositionDamper2DObject, PositionDamperObject, PositionInterpolator2DObject, PositionInterpolatorObject, PrimitivePickSensorObject, ProtoDeclareObject, ProtoInstanceObject, ProximitySensorObject, ReceiverPduObject, RigidBodyCollectionObject, ROUTEObject, ScalarChaserObject, ScalarDamperObject, ScalarInterpolatorObject, ScreenGroupObject, ScriptObject, SegmentedVolumeDataObject, ShapeObject, SignalPduObject, SoundObject, SphereSensorObject, SplinePositionInterpolator2DObject, SplinePositionInterpolatorObject, SplineScalarInterpolatorObject, SpotLightObject, SquadOrientationInterpolatorObject, StaticGroupObject, StringSensorObject, SwitchObject, TexCoordChaser2DObject, TexCoordDamper2DObject, TextureBackgroundObject, TimeSensorObject, TimeTriggerObject, TouchSensorObject, TransformObject, TransformSensorObject, TransmitterPduObject, ViewpointGroupObject, ViewpointObject, ViewportObject, VisibilitySensorObject, VolumeDataObject, VolumePickSensorObject, WorldInfoObject

See anything missing? 8)

If there are any specific constructs that are not working, please share.  There might be a hole here, or there might be a different invocation method that is appropriate.  As ever, thanks.

> On 3/15/2017 10:20 AM, yottzumm at gmail.com wrote:
>> Once append* is deployed, let me know.
>>
>> Thanks,
>>
>> john
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>>
>>
>>
>> *From: *Don Brutzman <mailto:brutzman at nps.edu>
>> *Sent: *Tuesday, March 14, 2017 1:16 PM
>> *To: *yottzumm at gmail.com <mailto:yottzumm at gmail.com>
>> *Cc: *Roy Walmsley <mailto:roy.walmsley at ntlworld.com>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
>> *Subject: *Re: X3DJSAIL: Desired chaining methods. Modify return value orprovide new method.
>>
>>
>>
>> This turns out to be trickier than first suspected.  The conflicting issue is that the legacy SAI methods use a pattern that returns void (i.e. no value) instead of a copy of the object for subsequent method pipelining.
>>
>>
>>
>> So instead of modifying the existing methods, I added "append" methods that take a single child for appending to the subject array.
>>
>>
>>
>> http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/HAnim/HAnimHumanoidObject.html#method.summary
>>
>>
>>
>> HAnimHumanoidObject                appendJoints(HAnimJoint newValue)
>>
>>                                                 Append single child joints node to array of existing nodes (if any).
>>
>> HAnimHumanoidObject                appendSegments(HAnimSegment newValue)
>>
>>                                                 Append single child segments node to array of existing nodes (if any).
>>
>> HAnimHumanoidObject                appendSites(HAnimSite newValue)
>>
>>                                                 Append single child sites node to array of existing nodes (if any).
>>
>> HAnimHumanoidObject                appendSkeleton(X3DNode newValue)
>>
>>                                                 Append single child skeleton node to array of existing nodes (if any).
>>
>> HAnimHumanoidObject                appendSkin(X3DChildNode newValue)
>>
>>                                                 Append single child skin node to array of existing nodes (if any).
>>
>> HAnimHumanoidObject                appendViewpoints(HAnimSite newValue)
>>
>>                                                 Append single child viewpoints node to array of existing nodes (if any).
>>
>>
>>
>> Similar methods appear elsewhere for appending a single node to an MFNode array field.
>>
>>
>>
>> For clarity and to have a consistent pattern (which helps code generators like yours)
>>
>> we should probably change utility methods like "addChild" to "appendChild" throughout.
>>
>> What do you think?
>>
>>
>>
>> Specification considerations noted as follows:
>>
>>
>>
>> X3dJavaSpecificationChangesAndIssues.txt                             14 March 2017
>>
>> http://www.web3d.org/x3d/stylesheets/java/X3dJavaSpecificationChangesAndIssues.txt
>>
>> ============================================================
>>
>> 3. SFNode/MFNode return types void
>>
>>
>>
>> Numerous interface return types are void, preventing a method from returning the
>>
>> current object from returning a copy of itself to permit method pipelining.
>>
>>
>>
>> Various utility methods have been added (typically named append* instead of add*)
>>
>> in order to circumvent this restriction.
>>
>>
>>
>> Need to consider changing SFNode/MFNode return signatures to support pipelining.
>>
>> Of note is that a method returning a null value is essentially the same as a
>>
>> void return, so no loss of functionality seems involved with this approach.
>>
>>
>>
>> ============================================================
>>
>> On 3/10/2017 1:14 PM, yottzumm at gmail.com wrote:
>>
>>> Maybe all these methods of HAnimHumanoiObject should return an HAnimHumanoidObject for chaining:
>>
>>>
>>
>>>
>>
>>>
>>
>>>         public void addJoints(HAnimJoint newValue)
>>
>>>
>>
>>>         public void addJoints(X3DNode[] newValue)
>>
>>>
>>
>>>         public void addSegments(HAnimSegment newValue)
>>
>>>
>>
>>>         public void addSegments(X3DNode[] newValue)
>>
>>>
>>
>>>         public void addSites(HAnimSite newValue)
>>
>>>
>>
>>>         public void addSites(X3DNode[] newValue)
>>
>>>
>>
>>>        public void addSkeleton(X3DNode newValue)
>>
>>>
>>
>>>         public void addSkeleton(X3DNode[] newValue)
>>
>>>
>>
>>>         public void addSkin(X3DChildNode newValue)
>>
>>>
>>
>>>         public void addSkin(X3DNode[] newValue)
>>
>>>
>>
>>>         public void addViewpoints(HAnimSite newValue)
>>
>>>
>>
>>>         public void addViewpoints(X3DNode[] newValue)
>>
>>>
>>
>>> John
>>
>>
>>
>> all the best, Don
>>
>> --
>>
>> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
>>
>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
>>
>> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
>>
>>
>>
>
>
> all the best, Don


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list