<?xml version="1.0"?>

<st-source>
<!-- 
Name: CADSM-Misc
HideSource: false
PackageName: CADSM-Misc
Parcel: #('cadsmmisc')
PrerequisiteParcels: #(#('SUnit' '') #('SUnitPreload' '') #('SUnitUI' '') #('RuntimePackager' '') #('CiphersBase' ''))
SaveSource: true
Version: 2
Date: 4:22:39 pm October 30, 2009
 -->
<time-stamp>From VisualWorks®, 7.5 of April 16, 2007 on October 30, 2009 at 4:22:39 pm</time-stamp>


<do-it>(Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned.  Choose terminate or close.']</do-it>

<class>
<name>CADSMMiscOrderedSet</name>
<environment>CADSM.Misc</environment>
<super>Core.OrderedCollection</super>
<private>false</private>
<indexed-type>objects</indexed-type>
<inst-vars>comparisonBlock </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMData</name>
<environment>CADSM.Misc</environment>
<super>CADSMItem</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataSSdotSddot</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>s sdot sddot </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataForceTorque</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>aFIO aTIO </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataRegistration</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>aProductID aHardwareID aInstallDate aFullName aEmail aRSAPublicKey2 aRSAPrivateKey2 aRegistrationDate aSupportExpirationDate aPatchID </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataPosVelAcc</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>refData rFfF aAFf vFfF omeFfF aFfF alpFfF </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<comment>
<class-id>CADSM.Misc.CADSMDataPosVelAcc</class-id>
<body>refData is the reference data. It is the data for frame F.</body>
</comment>

<class>
<name>CADSMDataTimePosVelAcc</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>time aDataPosVelAcc </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataSimulation</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>errorTolPosKine errorTolAccKine iterMaxPosKine iterMaxAccKine tstart hmin hmax tend hout corAbsTol corRelTol intAbsTol intRelTol iterMaxDyn orderMax translationLimit rotationLimit </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMMiscBoundingBox</name>
<environment>CADSM.Misc</environment>
<super>CADSMItem</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>minCorner maxCorner </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMMiscBoundingRectangle</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMMiscBoundingBox</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataMassJpp</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>mass aJpp </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataAnimation</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>nframe icurrent istart iend isForward framesPerSecond </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMMiscSettings</name>
<environment>CADSM.Misc</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>objects</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMDataTimePosVelAccDyn</name>
<environment>CADSM.Misc</environment>
<super>CADSM.Misc.CADSMData</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>time aDataPosVelAcc aDataMassJpp </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<class>
<name>CADSMTest</name>
<environment>CADSM.Misc</environment>
<super>XProgramming.SUnit.TestCase</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>aDict </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Misc</category>
<attributes>
<package>CADSM-Misc</package>
</attributes>
</class>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="forEquality">forEquality
	comparisonBlock := [:a :b | a = b]</body>

<body package="CADSM-Misc" selector="forIdentity">forIdentity
	comparisonBlock := [:a :b | a == b]</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>adding</category>

<body package="CADSM-Misc" selector="addFirst:">addFirst: newObject 
	(self includes: newObject) ifFalse: [super addFirst: newObject].
	^newObject</body>

<body package="CADSM-Misc" selector="addLast:">addLast: newObject 
	(self includes: newObject) ifFalse: [super addLast: newObject].
	^newObject</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>testing</category>

<body package="CADSM-Misc" selector="includes:">includes: anObject 
	firstIndex to: lastIndex
		do: 
			[:i | 
			(comparisonBlock value: anObject value: (self basicAt: i)) ifTrue: [^true]].
	^false</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>removing</category>

<body package="CADSM-Misc" selector="remove:ifAbsent:">remove: oldObject ifAbsent: anExceptionBlock 
	"Remove oldObject as one of the receiver's elements.  If several of the
	elements are equal to oldObject, only one is removed. If no element is equal to
	oldObject, answer the result of evaluating anExceptionBlock.  Otherwise,
	answer the argument, oldObject."

	firstIndex to: lastIndex
		do: 
			[:index | 
			(comparisonBlock value: oldObject value: (self basicAt: index)) 
				ifTrue: 
					[self removeIndex: index.
					^oldObject]].
	^anExceptionBlock value</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>private</category>

<body package="CADSM-Misc" selector="find:">find: oldObject 
	| index |
	index := firstIndex.
	
	[index &lt;= lastIndex 
		and: [(comparisonBlock value: oldObject value: (self basicAt: index)) not]] 
			whileTrue: [index := index + 1].
	index &lt;= lastIndex ifTrue: [^index] ifFalse: [^self notFoundError]</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>As yet unclassified</category>

<body package="CADSM-Misc" selector="cyclicShiftElementToTop:">cyclicShiftElementToTop: block 
	| index |
	index := self findFirst: block.
	self shiftElementUp: index - 1</body>

<body package="CADSM-Misc" selector="shiftElementUp:">shiftElementUp: n 
	1 to: n do: [:i | self addLast: self removeFirst]</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="comparisonBlock">comparisonBlock
	^comparisonBlock</body>

<body package="CADSM-Misc" selector="comparisonBlock:">comparisonBlock: anObject
	comparisonBlock := anObject</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscOrderedSet class</class-id> <category>instance creation</category>

<body package="CADSM-Misc" selector="new">new
	^self newIdentity: 10</body>

<body package="CADSM-Misc" selector="new:">new: n 
	^self newIdentity: n</body>

<body package="CADSM-Misc" selector="newEquality:">newEquality: size 
	^(super new: size) forEquality</body>

<body package="CADSM-Misc" selector="newIdentity:">newIdentity: size 
	^(super new: size) forIdentity</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataSSdotSddot</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="initialize">initialize
	"Do nothing."</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataSSdotSddot</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="s">s
	^s</body>

<body package="CADSM-Misc" selector="s:">s: col 
	s := col</body>

<body package="CADSM-Misc" selector="sddot">sddot
	^sddot</body>

<body package="CADSM-Misc" selector="sddot:">sddot: col 
	sddot := col</body>

<body package="CADSM-Misc" selector="sdot">sdot
	^sdot</body>

<body package="CADSM-Misc" selector="sdot:">sdot: col 
	sdot := col</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataForceTorque</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="initialize">initialize
	"Do nothing."</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataForceTorque</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="aFIO">aFIO
	aFIO == nil ifTrue: [self aFIO: (StMFullColumn zero: 3)].
	^aFIO</body>

<body package="CADSM-Misc" selector="aFIO:">aFIO: col 
	aFIO := col</body>

<body package="CADSM-Misc" selector="aTIO">aTIO
	aTIO == nil ifTrue: [self aTIO: (StMFullColumn zero: 3)].
	^aTIO</body>

<body package="CADSM-Misc" selector="aTIO:">aTIO: col 
	aTIO := col</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataRegistration</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="aEmail">aEmail
	^aEmail</body>

<body package="CADSM-Misc" selector="aEmail:">aEmail: anObject
	aEmail := anObject</body>

<body package="CADSM-Misc" selector="aFullName">aFullName
	^aFullName</body>

<body package="CADSM-Misc" selector="aFullName:">aFullName: anObject
	aFullName := anObject</body>

<body package="CADSM-Misc" selector="aHardwareID">aHardwareID
	^aHardwareID</body>

<body package="CADSM-Misc" selector="aHardwareID:">aHardwareID: anObject
	aHardwareID := anObject</body>

<body package="CADSM-Misc" selector="aInstallDate">aInstallDate
	^aInstallDate</body>

<body package="CADSM-Misc" selector="aInstallDate:">aInstallDate: anObject
	aInstallDate := anObject</body>

<body package="CADSM-Misc" selector="aPatchID">aPatchID
	^aPatchID</body>

<body package="CADSM-Misc" selector="aPatchID:">aPatchID: anObject
	aPatchID := anObject</body>

<body package="CADSM-Misc" selector="aProductID">aProductID
	^aProductID</body>

<body package="CADSM-Misc" selector="aProductID:">aProductID: anObject
	aProductID := anObject</body>

<body package="CADSM-Misc" selector="aRegistrationDate">aRegistrationDate
	^aRegistrationDate</body>

<body package="CADSM-Misc" selector="aRegistrationDate:">aRegistrationDate: anObject
	aRegistrationDate := anObject</body>

<body package="CADSM-Misc" selector="aRSAPrivateKey2">aRSAPrivateKey2
	^aRSAPrivateKey2</body>

<body package="CADSM-Misc" selector="aRSAPrivateKey2:">aRSAPrivateKey2: anObject
	aRSAPrivateKey2 := anObject</body>

<body package="CADSM-Misc" selector="aRSAPublicKey2">aRSAPublicKey2
	^aRSAPublicKey2</body>

<body package="CADSM-Misc" selector="aRSAPublicKey2:">aRSAPublicKey2: anObject
	aRSAPublicKey2 := anObject</body>

<body package="CADSM-Misc" selector="aSupportExpirationDate">aSupportExpirationDate
	^aSupportExpirationDate</body>

<body package="CADSM-Misc" selector="aSupportExpirationDate:">aSupportExpirationDate: anObject
	aSupportExpirationDate := anObject</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataRegistration</class-id> <category>printing</category>

<body package="CADSM-Misc" selector="printOn:">printOn: aStream 
	aStream nextPutAll: 'aProductID := '.
	aStream
		print: aProductID;
		cr.
	aStream nextPutAll: 'aHardwareID := '.
	aStream
		print: aHardwareID;
		cr.
	aStream nextPutAll: 'aInstallDate := '.
	aStream
		print: aInstallDate;
		cr.
	aStream nextPutAll: 'aFullName := '.
	aStream
		print: aFullName;
		cr.
	aStream nextPutAll: 'aEmail := '.
	aStream
		print: aEmail;
		cr.
	aStream nextPutAll: 'aRSAPublicKey2 := '.
	aStream
		print: aRSAPublicKey2;
		cr.
	aStream nextPutAll: 'aRSAPrivateKey2 := '.
	aStream
		print: aRSAPrivateKey2;
		cr.
	aStream nextPutAll: 'aRegistrationDate := '.
	aStream
		print: aRegistrationDate;
		cr.
	aStream nextPutAll: 'aSupportExpirationDate := '.
	aStream
		print: aSupportExpirationDate;
		cr.
	aStream nextPutAll: 'aPatchID := '.
	aStream print: aPatchID</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataPosVelAcc</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="aAFf">aAFf
	^aAFf</body>

<body package="CADSM-Misc" selector="aAFf:">aAFf: anObject
	aAFf := anObject</body>

<body package="CADSM-Misc" selector="aFfF">aFfF
	^aFfF</body>

<body package="CADSM-Misc" selector="aFfF:">aFfF: anObject
	aFfF := anObject</body>

<body package="CADSM-Misc" selector="alpFfF">alpFfF
	^alpFfF</body>

<body package="CADSM-Misc" selector="alpFfF:">alpFfF: anObject
	alpFfF := anObject</body>

<body package="CADSM-Misc" selector="omeFfF">omeFfF
	^omeFfF</body>

<body package="CADSM-Misc" selector="omeFfF:">omeFfF: anObject
	omeFfF := anObject</body>

<body package="CADSM-Misc" selector="refData">refData
	^refData</body>

<body package="CADSM-Misc" selector="refData:">refData: anObject
	refData := anObject</body>

<body package="CADSM-Misc" selector="rFfF">rFfF
	^rFfF</body>

<body package="CADSM-Misc" selector="rFfF:">rFfF: anObject
	rFfF := anObject</body>

<body package="CADSM-Misc" selector="vFfF">vFfF
	^vFfF</body>

<body package="CADSM-Misc" selector="vFfF:">vFfF: anObject
	vFfF := anObject</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataSimulation</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="corAbsTol">corAbsTol
	corAbsTol == nil ifTrue: [corAbsTol := 1.0d-6].
	^corAbsTol</body>

<body package="CADSM-Misc" selector="corAbsTol:">corAbsTol: double 
	corAbsTol := double</body>

<body package="CADSM-Misc" selector="corRelTol">corRelTol
	corRelTol == nil ifTrue: [corRelTol := 1.0d-6].
	^corRelTol</body>

<body package="CADSM-Misc" selector="corRelTol:">corRelTol: double 
	corRelTol := double</body>

<body package="CADSM-Misc" selector="errorTol">errorTol
	intRelTol == nil ifTrue: [intRelTol := 1.0d-6].
	^intRelTol</body>

<body package="CADSM-Misc" selector="errorTol:">errorTol: double 
	errorTolPosKine := double.
	errorTolAccKine := double.
	corAbsTol := double.
	corRelTol := double.
	intAbsTol := double.
	intRelTol := double</body>

<body package="CADSM-Misc" selector="errorTolAccKine">errorTolAccKine
	errorTolAccKine == nil ifTrue: [errorTolAccKine := 1.0d-6].
	^errorTolAccKine</body>

<body package="CADSM-Misc" selector="errorTolAccKine:">errorTolAccKine: double 
	errorTolAccKine := double</body>

<body package="CADSM-Misc" selector="errorTolPosKine">errorTolPosKine
	errorTolPosKine == nil ifTrue: [errorTolPosKine := 1.0d-6].
	^errorTolPosKine</body>

<body package="CADSM-Misc" selector="errorTolPosKine:">errorTolPosKine: double 
	errorTolPosKine := double</body>

<body package="CADSM-Misc" selector="hmax">hmax
	hmax == nil ifTrue: [hmax := 1.0d].
	^hmax</body>

<body package="CADSM-Misc" selector="hmax:">hmax: double 
	hmax := double</body>

<body package="CADSM-Misc" selector="hmin">hmin
	hmin == nil ifTrue: [hmin := 1.0d-9].
	^hmin</body>

<body package="CADSM-Misc" selector="hmin:">hmin: double 
	hmin := double</body>

<body package="CADSM-Misc" selector="hout">hout
	hout == nil ifTrue: [hout := 0.1d].
	^hout</body>

<body package="CADSM-Misc" selector="hout:">hout: double 
	hout := double</body>

<body package="CADSM-Misc" selector="intAbsTol">intAbsTol
	intAbsTol == nil ifTrue: [intAbsTol := 1.0d-6].
	^intAbsTol</body>

<body package="CADSM-Misc" selector="intAbsTol:">intAbsTol: double 
	intAbsTol := double</body>

<body package="CADSM-Misc" selector="intRelTol">intRelTol
	intRelTol == nil ifTrue: [intRelTol := 1.0d-6].
	^intRelTol</body>

<body package="CADSM-Misc" selector="intRelTol:">intRelTol: double 
	intRelTol := double</body>

<body package="CADSM-Misc" selector="iterMaxAccKine">iterMaxAccKine
	iterMaxAccKine == nil ifTrue: [iterMaxAccKine := 25].
	^iterMaxAccKine</body>

<body package="CADSM-Misc" selector="iterMaxAccKine:">iterMaxAccKine: integer 
	iterMaxAccKine := integer</body>

<body package="CADSM-Misc" selector="iterMaxDyn">iterMaxDyn
	iterMaxDyn == nil ifTrue: [iterMaxDyn := 8].
	^iterMaxDyn</body>

<body package="CADSM-Misc" selector="iterMaxDyn:">iterMaxDyn: integer 
	iterMaxDyn := integer</body>

<body package="CADSM-Misc" selector="iterMaxPosKine">iterMaxPosKine
	iterMaxPosKine == nil ifTrue: [iterMaxPosKine := 25].
	^iterMaxPosKine</body>

<body package="CADSM-Misc" selector="iterMaxPosKine:">iterMaxPosKine: integer 
	iterMaxPosKine := integer</body>

<body package="CADSM-Misc" selector="orderMax">orderMax
	orderMax == nil ifTrue: [orderMax := 5].
	^orderMax</body>

<body package="CADSM-Misc" selector="orderMax:">orderMax: integer 
	orderMax := integer</body>

<body package="CADSM-Misc" selector="rotationLimit">rotationLimit
	rotationLimit == nil ifTrue: [rotationLimit := 0.5d].
	^rotationLimit</body>

<body package="CADSM-Misc" selector="rotationLimit:">rotationLimit: double 
	rotationLimit := double</body>

<body package="CADSM-Misc" selector="tend">tend
	tend == nil ifTrue: [tend := 1.0d].
	^tend</body>

<body package="CADSM-Misc" selector="tend:">tend: double 
	tend := double</body>

<body package="CADSM-Misc" selector="translationLimit">translationLimit
	translationLimit == nil ifTrue: [translationLimit := 1.0d10].
	^translationLimit</body>

<body package="CADSM-Misc" selector="translationLimit:">translationLimit: double 
	translationLimit := double</body>

<body package="CADSM-Misc" selector="tstart">tstart
	tstart == nil ifTrue: [tstart := 0.0d].
	^tstart</body>

<body package="CADSM-Misc" selector="tstart:">tstart: double 
	tstart := double</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="center">center
	^minCorner + maxCorner / 2.0d</body>

<body package="CADSM-Misc" selector="expandToBound1:">expandToBound1: point 
	minCorner := minCorner min: point.
	maxCorner := maxCorner max: point</body>

<body package="CADSM-Misc" selector="expandToBound:">expandToBound: aPointOrBox 
	aPointOrBox fitSelfInBox: self</body>

<body package="CADSM-Misc" selector="initialize">initialize
	minCorner := StMFullColumn new: 3.
	maxCorner := StMFullColumn new: 3</body>

<body package="CADSM-Misc" selector="zeroSelf">zeroSelf
	minCorner zeroSelf.
	maxCorner zeroSelf</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>copying</category>

<body package="CADSM-Misc" selector="postCopy">postCopy
	minCorner := minCorner copy.
	maxCorner := maxCorner copy</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>printing</category>

<body package="CADSM-Misc" selector="printOn:">printOn: aStream 
	aStream
		print: self class;
		nextPut: $(;
		cr;
		print: minCorner;
		cr;
		print: maxCorner;
		cr;
		nextPut: $)</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>ops</category>

<body package="CADSM-Misc" selector="fitSelfInBox:">fitSelfInBox: aBoundingBox 
	self isDefined 
		ifTrue: 
			[aBoundingBox isDefined 
				ifTrue: 
					[aBoundingBox origin: (minCorner min: aBoundingBox minCorner)
						corner: (maxCorner max: aBoundingBox maxCorner)]
				ifFalse: [aBoundingBox origin: minCorner copy corner: maxCorner copy]]</body>

<body package="CADSM-Misc" selector="inRefFrame:">inRefFrame: aFrame 
	"I am f frame. Transform to F frame."

	| answer |
	^self isDefined 
		ifTrue: 
			[answer := self class new.
			self cCorner inject: answer
				into: [:bbox :corner | bbox expandToBound: (aFrame rFpFfromrfpf: corner)].
			answer]
		ifFalse: [self]</body>

<body package="CADSM-Misc" selector="merge:">merge: aBoundingBox 
	"Answer a BoundingBox that contains both the receiver and  the
	argument aBoundingBox."

	^self isDefined 
		ifTrue: 
			[aBoundingBox isDefined 
				ifTrue: 
					[self species origin: (minCorner min: aBoundingBox minCorner)
						corner: (maxCorner max: aBoundingBox maxCorner)]
				ifFalse: [self species origin: minCorner copy corner: maxCorner copy]]
		ifFalse: 
			[aBoundingBox isDefined 
				ifTrue: 
					[self species origin: aBoundingBox minCorner copy
						corner: aBoundingBox maxCorner copy]
				ifFalse: [self species new]]</body>

<body package="CADSM-Misc" selector="zeroZcoord">zeroZcoord
	minCorner at: 3 put: 0.0d.
	maxCorner at: 3 put: 0.0d</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="cCorner">cCorner
	"Collection of corners of box."

	| answer x y z |
	answer := OrderedCollection new: 10.
	1 to: 2
		do: 
			[:i | 
			x := i = 1 ifTrue: [minCorner at: 1] ifFalse: [maxCorner at: 1].
			1 to: 2
				do: 
					[:j | 
					y := j = 1 ifTrue: [minCorner at: 2] ifFalse: [maxCorner at: 2].
					1 to: 2
						do: 
							[:k | 
							z := k = 1 ifTrue: [minCorner at: 3] ifFalse: [maxCorner at: 3].
							answer add: (StMFullColumn 
										with: x
										with: y
										with: z)]]].
	^answer</body>

<body package="CADSM-Misc" selector="corner">corner
	^maxCorner</body>

<body package="CADSM-Misc" selector="dx">dx
	^(maxCorner at: 1) - (minCorner at: 1)</body>

<body package="CADSM-Misc" selector="dy">dy
	^(maxCorner at: 2) - (minCorner at: 2)</body>

<body package="CADSM-Misc" selector="dz">dz
	^(maxCorner at: 3) - (minCorner at: 3)</body>

<body package="CADSM-Misc" selector="extent">extent
	^maxCorner - minCorner</body>

<body package="CADSM-Misc" selector="maxCorner">maxCorner
	^maxCorner</body>

<body package="CADSM-Misc" selector="maxx">maxx
	^maxCorner at: 1</body>

<body package="CADSM-Misc" selector="maxxmaxymaxz">maxxmaxymaxz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (maxCorner at: 1).
	answer at: 2 put: (maxCorner at: 2).
	answer at: 3 put: (maxCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="maxxmaxyminz">maxxmaxyminz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (maxCorner at: 1).
	answer at: 2 put: (maxCorner at: 2).
	answer at: 3 put: (minCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="maxxminymaxz">maxxminymaxz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (maxCorner at: 1).
	answer at: 2 put: (minCorner at: 2).
	answer at: 3 put: (maxCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="maxxminyminz">maxxminyminz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (maxCorner at: 1).
	answer at: 2 put: (minCorner at: 2).
	answer at: 3 put: (minCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="maxy">maxy
	^maxCorner at: 2</body>

<body package="CADSM-Misc" selector="maxz">maxz
	^maxCorner at: 3</body>

<body package="CADSM-Misc" selector="minCorner">minCorner
	^minCorner</body>

<body package="CADSM-Misc" selector="minx">minx
	^minCorner at: 1</body>

<body package="CADSM-Misc" selector="minxmaxymaxz">minxmaxymaxz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (minCorner at: 1).
	answer at: 2 put: (maxCorner at: 2).
	answer at: 3 put: (maxCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="minxmaxyminz">minxmaxyminz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (minCorner at: 1).
	answer at: 2 put: (maxCorner at: 2).
	answer at: 3 put: (minCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="minxminymaxz">minxminymaxz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (minCorner at: 1).
	answer at: 2 put: (minCorner at: 2).
	answer at: 3 put: (maxCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="minxminyminz">minxminyminz
	| answer |
	answer := StMFullColumn new: 3.
	answer at: 1 put: (minCorner at: 1).
	answer at: 2 put: (minCorner at: 2).
	answer at: 3 put: (minCorner at: 3).
	^answer</body>

<body package="CADSM-Misc" selector="miny">miny
	^minCorner at: 2</body>

<body package="CADSM-Misc" selector="minz">minz
	^minCorner at: 3</body>

<body package="CADSM-Misc" selector="origin">origin
	^minCorner</body>

<body package="CADSM-Misc" selector="origin:corner:">origin: originPoint corner: cornerPoint 
	minCorner := originPoint.
	maxCorner := cornerPoint</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>As yet unclassified</category>

<body package="CADSM-Misc" selector="diagonal_length">diagonal_length
	^(maxCorner - minCorner) length</body>

<body package="CADSM-Misc" selector="magnifySelf:">magnifySelf: aDouble 
	self isDefined 
		ifTrue: 
			[minCorner magnifySelf: aDouble.
			maxCorner magnifySelf: aDouble]</body>

<body package="CADSM-Misc" selector="reverseSelf">reverseSelf
	| aPoint bPoint |
	aPoint := minCorner.
	bPoint := maxCorner.
	self initialize.
	aPoint y: aPoint y negated.
	bPoint y: bPoint y negated.
	self expandToBound: aPoint.
	self expandToBound: bPoint</body>

<body package="CADSM-Misc" selector="umax">umax
	^maxCorner at: 1</body>

<body package="CADSM-Misc" selector="umin">umin
	^minCorner at: 1</body>

<body package="CADSM-Misc" selector="uvwOfPoint:">uvwOfPoint: aPoint 
	| answer min max x range u |
	answer := StMFullColumn new: 3.
	1 to: 3
		do: 
			[:i | 
			min := minCorner at: i.
			max := maxCorner at: i.
			x := aPoint at: i.
			range := max - min.
			u := range &lt; StMMachineAccuracy OfDoubleTimesFour 
						ifTrue: [0.0d]
						ifFalse: [(x - min) / range].
			answer at: i put: u].
	^answer</body>

<body package="CADSM-Misc" selector="uvwScale">uvwScale
	| answer range scale |
	answer := StMFullColumn new: 3.
	1 to: 3
		do: 
			[:i | 
			range := (maxCorner at: i) - (minCorner at: i).
			scale := range &lt; StMMachineAccuracy OfDoubleTimesFour 
						ifTrue: [0.0d]
						ifFalse: [1.0d / range].
			answer at: i put: scale].
	^answer</body>

<body package="CADSM-Misc" selector="vmax">vmax
	^maxCorner at: 2</body>

<body package="CADSM-Misc" selector="vmin">vmin
	^minCorner at: 2</body>

<body package="CADSM-Misc" selector="wmax">wmax
	^maxCorner at: 3</body>

<body package="CADSM-Misc" selector="wmin">wmin
	^minCorner at: 3</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox</class-id> <category>testing</category>

<body package="CADSM-Misc" selector="contains:">contains: aBoundingBox 
	"Answer whether the receiver is equal to aBoundingBox or whether aBoundingBox
	is contained within the receiver."

	^minCorner &lt;= aBoundingBox minCorner 
		and: [aBoundingBox maxCorner &lt;= maxCorner]</body>

<body package="CADSM-Misc" selector="isDefined">isDefined
	^(minCorner at: 1) isReal</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingBox class</class-id> <category>instance creation</category>

<body package="CADSM-Misc" selector="origin:corner:">origin: originPoint corner: cornerPoint 
	^self new origin: originPoint corner: cornerPoint</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingRectangle</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="initialize">initialize
	minCorner := StMFullColumn new: 2.
	maxCorner := StMFullColumn new: 2</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMMiscBoundingRectangle</class-id> <category>As yet unclassified</category>

<body package="CADSM-Misc" selector="uvShift:">uvShift: uvShift 
	minCorner equalSelfPlus: uvShift.
	maxCorner equalSelfPlus: uvShift</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataAnimation</class-id> <category>initialize-release</category>

<body package="CADSM-Misc" selector="initialize">initialize
	nframe := 1000000.
	icurrent := 1.
	istart := 1.
	iend := 1000000.
	isForward := true.
	framesPerSecond := 30</body>

<body package="CADSM-Misc" selector="initialize:">initialize: integer 
	nframe := integer.
	iend := integer</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataAnimation</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="framesPerSecond">framesPerSecond
	^framesPerSecond</body>

<body package="CADSM-Misc" selector="framesPerSecond:">framesPerSecond: integer 
	framesPerSecond := integer</body>

<body package="CADSM-Misc" selector="icurrent">icurrent
	^icurrent</body>

<body package="CADSM-Misc" selector="icurrent:">icurrent: integer 
	icurrent := integer</body>

<body package="CADSM-Misc" selector="iend">iend
	^iend</body>

<body package="CADSM-Misc" selector="iend:">iend: integer 
	iend := integer abs min: nframe</body>

<body package="CADSM-Misc" selector="isForward">isForward
	^isForward</body>

<body package="CADSM-Misc" selector="isForward:">isForward: bool 
	isForward := bool</body>

<body package="CADSM-Misc" selector="istart">istart
	^istart</body>

<body package="CADSM-Misc" selector="istart:">istart: integer 
	istart := integer.
	istart := integer abs min: nframe</body>

<body package="CADSM-Misc" selector="nframe">nframe
	^nframe</body>

<body package="CADSM-Misc" selector="nframe:">nframe: integer 
	nframe := 0 max: integer abs.
	istart notNil ifTrue: [istart := istart min: nframe].
	iend notNil ifTrue: [iend := iend min: nframe]</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataAnimation</class-id> <category>printing</category>

<body package="CADSM-Misc" selector="storeOn:level:">storeOn: aStream level: level 
	aStream storeLevel: level title: 'AnimationParameters'.
	aStream
		storeLevel: level + 1
		title: 'nframe'
		object: nframe.
	aStream
		storeLevel: level + 1
		title: 'icurrent'
		object: icurrent.
	aStream
		storeLevel: level + 1
		title: 'istart'
		object: istart.
	aStream
		storeLevel: level + 1
		title: 'iend'
		object: iend.
	aStream
		storeLevel: level + 1
		title: 'isForward'
		object: isForward.
	aStream
		storeLevel: level + 1
		title: 'framesPerSecond'
		object: framesPerSecond</body>

<body package="CADSM-Misc" selector="storePOVOn:level:">storePOVOn: aStream level: level 
	"Do nothing."</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMDataAnimation class</class-id> <category>instance creation</category>

<body package="CADSM-Misc" selector="new:">new: integer 
	^super new initialize: integer</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMTest</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="runAssembly:">runAssembly: oldAssembly 
	| aMediator |
	aDict := IdentityDictionary new.
	aMediator := CADSMUIMediator new.
	self at: #aMediator put: aMediator.
	oldAssembly driveCADSMTest: self.
	aMediator startDynamic.
	aMediator showTranscript</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMTest</class-id> <category>accessing</category>

<body package="CADSM-Misc" selector="aFixedPart">aFixedPart
	^self geoAssembly aFixedPart</body>

<body package="CADSM-Misc" selector="aMediator">aMediator
	^aDict at: #aMediator</body>

<body package="CADSM-Misc" selector="at:">at: aGeo 
	^aDict at: aGeo</body>

<body package="CADSM-Misc" selector="at:put:">at: aGeo put: newGeo 
	aDict at: aGeo put: newGeo</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMTest</class-id> <category>testing</category>

<body package="CADSM-Misc" selector="openAssembly">openAssembly
	| titleString filterArray filenameString newName prompt readStream bos geoAssembly stack |
	self setTestSelector: #openAssembly.
	(('win32*' match: OSHandle currentPlatformID) 
		or: ['unix*linux*' match: OSHandle currentPlatformID]) 
			ifTrue: 
				[titleString := 'Open an Assembly'.
				filterArray := OrderedCollection new.
				filterArray 
					add: (CommonFileFilter filter: '*.asm*' description: '*.asm*  (Assembly)').
				filterArray 
					add: (CommonFileFilter filter: '*.*' description: '*.*  (All)').
				filenameString := ''.
				newName := CommonFileSelectionDialog 
							openTitle: titleString
							filters: filterArray
							filename: filenameString
							mustExist: true]
			ifFalse: 
				[prompt := 'Enter filename to read a Assembly.  Use wildcards (*.asm) to get list of relevant Assembly files.'.
				newName := self fileName.
				newName := Dialog requestFileName: prompt default: '*.asm*'].
	(newName notNil and: [newName isEmpty not]) 
		ifTrue: 
			[readStream := newName asFilename readStream.
			
			[bos := StCAD.BinaryObjectStorage onOldNoScan: readStream.
			geoAssembly := bos contents at: 1] 
					ensure: [readStream close].
			geoAssembly isNil 
				ifTrue: 
					[readStream := newName asFilename readStream.
					
					[stack := StCAD.StGeo.GeometryAsTextParser 
								parse: readStream contents cleanSourceFromSelf
								as: #asmt.
					geoAssembly := stack last] 
							valueNowOrOnUnwindDo: [readStream close]].
			(geoAssembly notNil and: [geoAssembly isAssembly]) 
				ifTrue: [self runAssembly: geoAssembly]
				ifFalse: [Dialog warn: 'Error reading an assembly from file.']]</body>

<body package="CADSM-Misc" selector="testSymbolicAssembly">testSymbolicAssembly
	"CADSMTest new testSymbolicAssembly"

	| aUniverse aAssembly iPart jPart iRefPoint jRefPoint iEndFrame jEndFrame aKinematicIJ |
	aUniverse := CADSM.MbD.CADSMMbDUniverse new.
	aAssembly := CADSM.MbD.CADSMMbDAssembly new.
	aUniverse addAssembly: aAssembly.
	iPart := CADSM.MbD.CADSMMbDPart new.
	jPart := CADSM.MbD.CADSMMbDPart new.
	aAssembly addAnyPart: iPart.
	aAssembly addAnyPart: jPart.
	iRefPoint := CADSM.MbD.CADSMMbDRefPoint new.
	jRefPoint := CADSM.MbD.CADSMMbDRefPoint new.
	iPart addRefGeo: iRefPoint.
	jPart addRefGeo: jRefPoint.
	iEndFrame := CADSM.MbD.CADSMMbDEndFrame new.
	jEndFrame := CADSM.MbD.CADSMMbDEndFrame new.
	iRefPoint addEndFrame: iEndFrame.
	jRefPoint addEndFrame: jEndFrame.
	aKinematicIJ := CADSM.MbD.CADSMMbDKinematicIJ aEndI: iEndFrame aEndJ: jEndFrame.
	aUniverse aRefFrame beSymbolic.
	aKinematicIJ inspect</body>
</methods>

<methods>
<class-id>CADSM.Misc.CADSMTest</class-id> <category>As yet unclassified</category>

<body package="CADSM-Misc" selector="aGeoUniverse">aGeoUniverse
	^self aMediator aGeoUniverse</body>

<body package="CADSM-Misc" selector="geoAssembly">geoAssembly
	^self aGeoUniverse activeAssembly</body>
</methods>

<methods>
<class-id>Core.Timestamp</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="postCopy">postCopy
	super postCOPY</body>
</methods>

<methods>
<class-id>StCAD.StMath.StMFullVector</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="asJun3dPoint">asJun3dPoint
	^Jun3dPoint 
		x: (self at: 1)
		y: (self at: 2)
		z: (self at: 3)</body>
</methods>

<methods>
<class-id>Security.RSAKey</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="=">= aKey 
	"Derived from Object&gt;&gt;equality:"

	^self == aKey or: 
			[self class == aKey class and: 
					[self basicSize == aKey basicSize and: 
							[1 to: self class instSize
								do: [:i | (self instVarAt: i) = (aKey instVarAt: i) ifFalse: [^false]].
							1 to: self basicSize
								do: [:i | (self at: i) = (aKey at: i) ifFalse: [^false]].
							true]]]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsSurface2">exampleNurbsSurface2
	"JunOpenGL3dNurbsSurface exampleNurbsSurface show."

	| controlPoints weights knots |
	controlPoints := JunMatrix new: 4.
	1 to: 4 do: [:x | 1 to: 4 do: [:y | controlPoints atPoint: x @ y put: (Jun3dPoint
					x: x - 2.5 * 2 / 3
					y: y - 2.5 * 2 / 3
					z: (((x = 2 or: [x = 3])
							and: [y = 2 or: [y = 3]])
							ifTrue: [1]
							ifFalse: [-1]))]].
	weights := JunMatrix new: 4 collection: ((1 to: 16)
					collect: [:i | i // 4 + 1 / 2.0]).
	knots := #(0.5 0.5 0.5 0.5 1.0 1.0 1.0 1.0).
	^JunOpenGL3dNurbsSurface
		controlPoints: (JunMatrix new: 4 collection: controlPoints)
		weights: weights
		uKnotVector: knots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="controlPoints:weights:knotVector:">controlPoints: anArrayOfPoints weights: anArrayOfNumber1 knotVector: anArrayOfNumber2 
	controlPoints := anArrayOfPoints.
	weights := anArrayOfNumber1.
	knotVector := anArrayOfNumber2</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsCone">exampleNurbsCone
	"JunOpenGL3dNurbsSurface exampleNurbsCone name: 'example'; paint: ColorValue blue; show."

	| n circleNurbs zEnd circleControlPoints controlPoints circleWeights weights point frontend backend middle knots circleKnots uMax |
	n := 2.
	circleNurbs := JunOpenGL3dNurbsCurve exampleCircle.
	zEnd := 2.0d.
	circleControlPoints := circleNurbs controlPoints.
	controlPoints := JunMatrix new: circleControlPoints size by: n.
	circleWeights := circleNurbs weights.
	weights := JunMatrix new: circleControlPoints size by: n.
	1 to: circleControlPoints size
		do: 
			[:i | 
			1 to: n
				do: 
					[:j | 
					point := (circleControlPoints at: i) copy.
					j == 2 
						ifTrue: 
							[point setX: 0.
							point setY: 0.
							point setZ: zEnd].
					controlPoints atPoint: i @ j put: point.
					weights atPoint: i @ j put: (circleWeights at: i)]].
	circleKnots := circleNurbs knotVector.
	uMax := circleKnots last.
	circleKnots := circleKnots collect: [:knot | knot asDouble / uMax].
	frontend := (Array new: n - 1)
				atAllPut: 0.0d;
				yourself.
	backend := (Array new: n - 1)
				atAllPut: 1.0d;
				yourself.
	middle := Array with: 0.0d with: 1.0d.
	knots := frontend , middle , backend.
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: circleKnots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="copyWrapFrom:to:">copyWrapFrom: start to: stop 
	| newSize answer nStartToEnd |
	^start &lt;= stop 
		ifTrue: 
			[newSize := stop - start + 1.
			answer := self species withSize: newSize.
			answer 
				replaceFrom: 1
				to: newSize
				with: self
				startingAt: start]
		ifFalse: 
			["Copy to the end, cycle to the beginning and continue copying to stop"

			nStartToEnd := self size - start + 1.
			newSize := nStartToEnd + stop.
			answer := self species withSize: newSize.
			answer 
				replaceFrom: 1
				to: nStartToEnd
				with: self
				startingAt: start.
			answer 
				replaceFrom: nStartToEnd + 1
				to: newSize
				with: self
				startingAt: 1]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="rFfocusF:">rFfocusF: col 
	sightPoint := col asJun3dPoint</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="reverse">reverse
	| answer answeruKnotVector size answerControlPoints nrow ncol |
	answer := self copy.
	answeruKnotVector := answer uKnotVector.
	size := uKnotVector size.
	1 to: size
		do: [:i | answeruKnotVector at: size - i + 1 put: (uKnotVector at: i) negated].
	answerControlPoints := answer controlPoints.
	nrow := controlPoints rowSize.
	ncol := controlPoints columnSize.
	1 to: nrow
		do: 
			[:i | 
			1 to: ncol
				do: 
					[:j | 
					answerControlPoints atPoint: (nrow - i + 1) @ j
						put: (controlPoints atPoint: i @ j)]].
	^answer</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="printVerboseOn:">printVerboseOn: aStream 
	self printOn: aStream</body>
</methods>

<methods>
<class-id>UI.ScrollWrapper</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="scroll:">scroll: aPoint 
	"Modified for CADSM. The original scroll: from the base image is scrollOriginal:"

	| maximumAmount minimumAmount amount |
	^(#{CADSM.UI.OpenGLView} isDefined 
		and: [component isKindOf: CADSM.UI.OpenGLView]) 
			ifTrue: 
				[maximumAmount := self scrollOffset + origin extraSpace origin max: 0 @ 0.
				minimumAmount := self scrollOffset + self visibleExtent 
							- self scrollableExtent min: 0 @ 0.
				amount := (aPoint min: maximumAmount) max: minimumAmount.
				amount ~= (0 @ 0) ifTrue: [component scroll: amount].
				^amount]
			ifFalse: [self scrollOriginal: aPoint]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjector</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="calcViewBoxFor:in:">calcViewBoxFor: aJun3dBoundingBox in: aOpenGLDisplayView 
	| aBitmap |
	aBitmap := aOpenGLDisplayView cachedBitmap.
	^aBitmap calcViewBoxFor: aJun3dBoundingBox
		with: projection asParallelProjection</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLRetainedMedium</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Support" selector="calcViewBoxFor:with:">calcViewBoxFor: aJun3dBoundingBox with: projection 
	| viewportPointer modelviewPointer projectionPointer windowxPointer windowyPointer windowzPointer block vertexs boundingBox |
	self renderingContext parallelProjection: projection.
	viewportPointer := CIntegerType long gcMalloc: 4.
	modelviewPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	projectionPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	windowxPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowyPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowzPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	OpenGLInterface glGetIntegerv: OpenGLInterface GL_VIEWPORT
		with: viewportPointer.
	OpenGLInterface glGetDoublev: OpenGLInterface GL_MODELVIEW_MATRIX
		with: modelviewPointer.
	OpenGLInterface glGetDoublev: OpenGLInterface GL_PROJECTION_MATRIX
		with: projectionPointer.
	block := 
			[:xyz | 
			OpenGLInterface 
				gluProject: xyz x asDouble
				with: xyz y asDouble
				with: xyz z asDouble
				with: modelviewPointer
				with: projectionPointer
				with: viewportPointer
				with: windowxPointer
				with: windowyPointer
				with: windowzPointer.
			StCAD.StMath.StMFullColumn 
				with: windowxPointer contents
				with: windowyPointer contents
				with: windowzPointer contents].
	vertexs := aJun3dBoundingBox vertexes.
	boundingBox := CADSM.Misc.CADSMMiscBoundingBox new.
	vertexs inject: boundingBox
		into: [:bbox :vertex | bbox expandToBound: (block value: vertex)].
	^boundingBox</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="order">order
	^knotVector size - controlPoints size</body>
</methods>

<methods>
<class-id>Core.Time class</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="secondsToRun:">secondsToRun: timedBlock 
	^((self microsecondsToRun: timedBlock) + 500000) // 1000000</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohcc">example5Kohcc
	"JunOpenGL3dNurbsSurface example5Kohcc."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface.
	trimCurve := JunOpenGL2dTrimNurbsCurve exampleTopSemiCircle.
	nurbs addTrimCurve: trimCurve.
	trimCurve := JunOpenGL2dTrimNurbsCurve exampleBottomSemiCircle.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>

<body package="Jun-OpenGL-Objects" selector="example6Koh">example6Koh
	"JunOpenGL3dNurbsSurface example6Koh."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface2.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1 @ 1).
	nurbs addTrimCurve: trimCurve.
	trimCurve := JunOpenGL2dTrimNurbsCurve nonconvexPolygon reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="breakIntoSizeOf:padWith:">breakIntoSizeOf: newSize padWith: padding 
	"Padding is done to the tail piece."

	| selfSize nWholePiece remainder cPiece start |
	selfSize := self size.
	nWholePiece := selfSize // newSize.
	remainder := selfSize \\ newSize.
	cPiece := OrderedCollection new: nWholePiece + 1.
	start := 1.
	1 to: nWholePiece
		do: 
			[:index | 
			| newPiece end |
			end := start + newSize - 1.
			newPiece := self copyFrom: start to: end.
			cPiece add: newPiece.
			start := end + 1].
	remainder &gt; 0 
		ifTrue: 
			[| tailPiece |
			tailPiece := (self species withSize: newSize) 
						replaceFrom: 1
						to: remainder
						with: self
						startingAt: start.
			remainder + 1 to: newSize do: [:i | tailPiece at: i put: padding].
			cPiece add: tailPiece].
	^cPiece</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="rFeyeF:">rFeyeF: col 
	eyePoint := col asJun3dPoint</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNonConvexPolygon class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleKoh">exampleKoh
	"JunOpenGL3dNonConvexPolygon exampleKoh."

	| outline nonConvexPolygon |
	outline := Array 
				with: 0 , 0 , 0
				with: 1 , 0 , 0
				with: 0.1 , 0.1 , 0
				with: 0 , 1 , 0.
	nonConvexPolygon := JunOpenGL3dNonConvexPolygon 
				vertexes: outline
				holes: Array new
				paint: ColorValue blue.
	nonConvexPolygon show.
	^nonConvexPolygon</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="printVerbose">printVerbose
	"Answer a String whose characters are a description of the receiver."

	| aStream |
	aStream := WriteStream on: (String new: 16).
	self printVerboseOn: aStream.
	^aStream contents</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="start:end:">start: startPoint end: endPoint 
	"JunOpenGL2dTrimNurbs start: 0 @ 0 end: 1.0 @ 1.0"

	| controlPoints weights knots |
	controlPoints := Array with: startPoint with: endPoint.
	weights := (Array new: 2)
				atAllPut: 1.0d;
				yourself.
	knots := #(0 0 1 1).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLRetainedMedium</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Support" selector="calcViewBoxFor:with1:">calcViewBoxFor: aJun3dBoundingBox with1: projection 
	| viewportPointer modelviewPointer projectionPointer windowxPointer windowyPointer windowzPointer block |
	self renderingContext parallelProjection: projection.
	viewportPointer := CIntegerType long gcMalloc: 4.
	modelviewPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	projectionPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	windowxPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowyPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowzPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	OpenGLInterface glGetIntegerv: OpenGLInterface GL_VIEWPORT
		with: viewportPointer.
	Transcript
		cr;
		show: ('viewport &lt;1p&gt; &lt;2p&gt; &lt;3p&gt; &lt;4p&gt;' 
					expandMacrosWith: (viewportPointer at: 0)
					with: (viewportPointer at: 1)
					with: (viewportPointer at: 2)
					with: (viewportPointer at: 3)).
	OpenGLInterface glGetDoublev: OpenGLInterface GL_MODELVIEW_MATRIX
		with: modelviewPointer.
	OpenGLInterface glGetDoublev: OpenGLInterface GL_PROJECTION_MATRIX
		with: projectionPointer.
	block := 
			[:x :y :z | 
			OpenGLInterface 
				gluProject: x asDouble
				with: y asDouble
				with: z asDouble
				with: modelviewPointer
				with: projectionPointer
				with: viewportPointer
				with: windowxPointer
				with: windowyPointer
				with: windowzPointer.
			Transcript
				cr;
				show: ('x &lt;1p&gt; y &lt;2p&gt; z &lt;3p&gt;' 
							expandMacrosWith: windowxPointer contents
							with: windowyPointer contents
							with: windowzPointer contents)].
	block 
		value: 0
		value: 0
		value: 0.
	block 
		value: 1
		value: 0
		value: 0.
	block 
		value: 0
		value: 1
		value: 0.
	block 
		value: 0
		value: 0
		value: 1</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohd">example5Kohd
	"JunOpenGL3dNurbsSurface example5Kohd."

	| nurbs points trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsCylSurface.
	points := Array new: 5.
	points at: 1 put: -0.1 , -0.1.
	points at: 2 put: 1.1 , -0.1.
	points at: 3 put: 1.1 , 1.1.
	points at: 4 put: -0.1 , 1.1.
	points at: 5 put: -0.1 , -0.1.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points.
	nurbs addTrimCurve: trimCurve.
	points := Array new: 5.
	points at: 1 put: 0.3 , 0.3.
	points at: 2 put: 0.8 , 0.3.
	points at: 3 put: 0.8 , 0.8.
	points at: 4 put: 0.3 , 0.8.
	points at: 5 put: 0.3 , 0.3.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNonConvexPolygon</class-id> <category>rendering</category>

<body package="Jun-OpenGL-Objects" selector="renderOn1:">renderOn1: aRenderingContext 
	| oldTextureCoordinateIndex |
	self hasPaint ifTrue: [aRenderingContext paint: self paint].
	self hasAlpha ifTrue: [aRenderingContext alpha: self alpha].
	self hasStipple ifTrue: [self stipple enableStippleOn: aRenderingContext].
	self hasTexture
		ifTrue: 
			[oldTextureCoordinateIndex := aRenderingContext textureCoordinateIndex.
			aRenderingContext textureCoordinateIndex: 1.
			self texture enableTextureOn: aRenderingContext].
	self hasTransparency
		ifTrue: 
			[aRenderingContext enableCullFace.
			aRenderingContext disableDepthMask.
			aRenderingContext enableBlending].
	aRenderingContext
		displayTriangles: self triangles
		outline: self vertexes
		holes: self holes
		normalVector: self normalVector.
	self hasTransparency
		ifTrue: 
			[aRenderingContext disableCullFace.
			aRenderingContext enableDepthMask.
			aRenderingContext disableBlending].
	self hasTexture
		ifTrue: 
			[self texture disableTextureOn: aRenderingContext.
			aRenderingContext textureCoordinateIndex: oldTextureCoordinateIndex].
	self hasStipple ifTrue: [self stipple disableStippleOn: aRenderingContext]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohe">example5Kohe
	"JunOpenGL3dNurbsSurface example5Kohe."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsCylSurface.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: -0.1 @ -0.1 corner: 1.1 @ 1.1).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.3 @ 0.3 corner: 0.8 @ 0.8)) 
					reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Core.Collection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="soleItem">soleItem
	| size |
	size := self size.
	^size == 0 
		ifTrue: [nil]
		ifFalse: 
			[size == 1 
				ifTrue: [self asArray at: 1]
				ifFalse: [self error: 'There is more than one item.']]</body>
</methods>

<methods>
<class-id>Jun.JunColorChoiceModel class</class-id> <category>CADSM</category>

<body package="Jun-Goodies-Color" selector="clearBarsAndPlates">clearBarsAndPlates
	bars := nil.
	plates := nil</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="postCOPY">postCOPY
	"Testing an alternative for Object&gt;&gt;postCopy"

	1 to: self class instSize
		do: [:i | self instVarAt: i put: (self instVarAt: i) copy].
	1 to: self basicSize do: [:i | self basicAt: i put: (self basicAt: i) copy]</body>
</methods>

<methods>
<class-id>UI.ScrollBarTracker</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="stepDelay">stepDelay
	^100</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="rFupF:">rFupF: col 
	upVector := col asJun3dPoint</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="nonconvexPolygon1">nonconvexPolygon1
	| controlPoints weights knots |
	controlPoints := Array new: 5.
	controlPoints at: 1 put: 0 , 0.
	controlPoints at: 2 put: 1 , 0.
	controlPoints at: 3 put: 0.25 , 0.25.
	controlPoints at: 4 put: 0 , 1.
	controlPoints at: 5 put: 0 , 0.
	weights := Array new: 5.
	weights at: 1 put: 1.0.
	weights at: 2 put: 1.0.
	weights at: 3 put: 1.0.
	weights at: 4 put: 1.0.
	weights at: 5 put: 1.0.
	knots := #(0 0 1 2 3 4 4).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLRetainedMedium</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Support" selector="scrollProjector:by:">scrollProjector: aProjector by: aPoint 
	| projection viewportPointer modelviewPointer projectionPointer windowxPointer windowyPointer windowzPointer cadsmxPointer cadsmyPointer cadsmzPointer block eyePointPx sightPointPx |
	projection := aProjector projection.
	self renderingContext parallelProjection: projection asParallelProjection.
	viewportPointer := CIntegerType long gcMalloc: 4.
	modelviewPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	projectionPointer := CLimitedPrecisionRealType double gcMalloc: 16.
	windowxPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowyPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	windowzPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	cadsmxPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	cadsmyPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	cadsmzPointer := CLimitedPrecisionRealType double gcMalloc: 1.
	OpenGLInterface glGetIntegerv: OpenGLInterface GL_VIEWPORT
		with: viewportPointer.
	OpenGLInterface glGetDoublev: OpenGLInterface GL_MODELVIEW_MATRIX
		with: modelviewPointer.
	OpenGLInterface glGetDoublev: OpenGLInterface GL_PROJECTION_MATRIX
		with: projectionPointer.
	block := 
			[:xyz | 
			OpenGLInterface 
				gluProject: xyz x asDouble
				with: xyz y asDouble
				with: xyz z asDouble
				with: modelviewPointer
				with: projectionPointer
				with: viewportPointer
				with: windowxPointer
				with: windowyPointer
				with: windowzPointer.
			StCAD.StMath.StMFullColumn 
				with: windowxPointer contents
				with: windowyPointer contents
				with: windowzPointer contents].
	eyePointPx := block value: projection eyePoint.
	sightPointPx := block value: projection sightPoint.
	eyePointPx x: eyePointPx x + aPoint x negated.
	eyePointPx y: eyePointPx y + aPoint y.
	sightPointPx x: sightPointPx x + aPoint x negated.
	sightPointPx y: sightPointPx y + aPoint y.
	block := 
			[:xyz | 
			OpenGLInterface 
				gluUnProject: xyz x asDouble
				with: xyz y asDouble
				with: xyz z asDouble
				with: modelviewPointer
				with: projectionPointer
				with: viewportPointer
				with: cadsmxPointer
				with: cadsmyPointer
				with: cadsmzPointer.
			Jun3dPoint 
				x: cadsmxPointer contents
				y: cadsmyPointer contents
				z: cadsmzPointer contents].
	projection eyePoint: (block value: eyePointPx).
	projection sightPoint: (block value: sightPointPx).
	aProjector setProjection: projection</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohccc">example5Kohccc
	"JunOpenGL3dNurbsSurface example5Kohccc."

	| nurbs points trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface.
	points := OrderedCollection new: 10.
	points
		add: 0.0 , 0.0;
		add: 0.1 , 0.0;
		add: 0.10000001 , 0.0;
		add: 1.0 , 0.0;
		add: 1.0 , 1.0;
		add: 0.0 , 1.0;
		add: 0.0 , 0.0.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points.
	nurbs addTrimCurve: trimCurve.
	points := OrderedCollection new: 10.
	points
		add: 0.3 , 0.3;
		add: 0.6 , 0.3;
		add: 0.6 , 0.6;
		add: 0.3 , 0.6;
		add: 0.3 , 0.3.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsCurve class</class-id> <category>examples</category>

<body package="Jun-OpenGL-Objects" selector="exampleEllipseHalf">exampleEllipseHalf
	"JunOpenGL3dNurbsCurve exampleEllipseHalf show."

	| controlPoints weights knots |
	controlPoints := Array new: 4.
	controlPoints at: 1 put: 2 , 0 , 0.
	controlPoints at: 2 put: 2 , 2 , 0.
	controlPoints at: 3 put: -2 , 2 , 0.
	controlPoints at: 4 put: -2 , 0 , 0.
	weights := Array new: 4.
	weights at: 1 put: 1.0.
	weights at: 2 put: 1 / 3.0.
	weights at: 3 put: 1 / 3.0.
	weights at: 4 put: 1.0.
	knots := #(-1 -1 -1 -1 0 0 0 0).
	^JunOpenGL3dNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohff">example5Kohff
	"JunOpenGL3dNurbsSurface example5Kohff."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface reverse.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: -1 @ 0 corner: 0 @ 1).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: -0.6 @ 0.3 corner: -0.3 @ 0.6)) 
					reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>UI.TextCollector</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="crcrShow:">crcrShow: aString 
	self
		cr;
		crShow: aString</body>
</methods>

<methods>
<class-id>Core.LargeInteger</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="postCopy">postCopy
	super postCOPY</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="concatenateCollectionsWith:">concatenateCollectionsWith: aObject 
	"Receiver is a collection of similar collections. Return the concatenated collection."

	| aStream |
	aStream := String new writeStream.
	self do: [:aString | aStream nextPutAll: aString]
		separatedBy: [aStream nextPut: aObject].
	^aStream contents</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="performIfCan:withArguments:else:">performIfCan: selector withArguments: aArray else: block 
	^(self class canUnderstand: selector) 
		ifTrue: [self perform: selector withArguments: aArray]
		ifFalse: 
			[| nSize newArray |
			nSize := aArray size + 1.
			newArray := Array new: nSize.
			newArray at: 1 put: self.
			newArray 
				replaceFrom: 2
				to: nSize
				with: aArray.
			block valueWithArguments: newArray]</body>
</methods>

<methods>
<class-id>Core.Timestamp</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="addHours:">addHours: aHourCount 
	^self addSeconds: aHourCount * 3600</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="exampleBottomSemiCircle">exampleBottomSemiCircle
	"JunOpenGL2dTrimNurbsCurve exampleBottomSemiCircle"

	| controlPoints weights knots |
	controlPoints := Array new: 3.
	controlPoints at: 1 put: -1 , 0 , 0.
	controlPoints at: 2 put: 0 , -1 , 0.
	controlPoints at: 3 put: 1 , 0 , 0.
	weights := Array new: 3.
	weights at: 1 put: 1.0d.
	weights at: 2 put: 0.0d.
	weights at: 3 put: 1.0d.
	knots := #(0 0 0 1 1 1).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLPerspectiveProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="viewYupXright">viewYupXright
	| rFeyeF rFfocusF reyefocus ufocuseyeF rFupF |
	rFeyeF := self rFeyeF.
	rFfocusF := self rFfocusF.
	reyefocus := (rFfocusF - rFeyeF) length.
	ufocuseyeF := StCAD.StMath.StMFullColumn 
				with: 0.0d
				with: 0.0d
				with: 1.0d.
	rFeyeF := rFfocusF plusFullColumn: ufocuseyeF times: reyefocus.
	rFupF := StCAD.StMath.StMFullColumn 
				with: 0.0d
				with: 1.0d
				with: 0.0d.
	self rFeyeF: rFeyeF.
	self rFupF: rFupF</body>
</methods>

<methods>
<class-id>UI.ScrollWrapper</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="scrollCADSM">scrollCADSM
	| aGraphicsContext |
"	self topComponent ifNotNil: [:rcvr | rcvr sensor pseudoEvent]."
	aGraphicsContext := self graphicsContext.
	aGraphicsContext intersectClip: self compositionBounds.
	aGraphicsContext paint: self foregroundColor.
	self displayOn: aGraphicsContext.
	self updateControls.
	self updateSpot: #scroll</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohb">example5Kohb
	"JunOpenGL3dNurbsSurface example5Kohb."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsSurface2.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1.0 @ 1.0).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.2 @ 0.2 corner: 0.8 @ 0.8)) 
					reverse.
	nurbs addTrimCurve: trimCurve.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.3 @ 0.3 corner: 0.6 @ 0.6).
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>UI.TextCollector</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="crShow:">crShow: aString 
	self
		cr;
		show: aString</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohc">example5Kohc
	"JunOpenGL3dNurbsSurface example5Kohc."

	| nurbs points trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface.
	points := Array new: 5.
	points at: 1 put: -0.5 , -0.5.
	points at: 2 put: 1.5 , -0.5.
	points at: 3 put: 1.5 , 1.5.
	points at: 4 put: -0.5 , 1.5.
	points at: 5 put: -0.5 , -0.5.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points.
	nurbs addTrimCurve: trimCurve.
	points := Array new: 5.
	points at: 1 put: 0.3 , 0.3.
	points at: 2 put: 0.6 , 0.3.
	points at: 3 put: 0.6 , 0.6.
	points at: 4 put: 0.3 , 0.6.
	points at: 5 put: 0.3 , 0.3.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="replaceFrom:with:from:to:">replaceFrom: start with: replacement from: repStart to: repStop 
	"This destructively replaces elements from start to stop in the 
	receiver starting at index, repStart, in the collection, replacement. 
	Answer the receiver. No range checks are performed, but 
	overlapping replacements are handled correctly."

	^self 
		replaceFrom: start
		to: start + repStop - repStart
		with: replacement
		startingAt: repStart</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="performIfCan:with:with:with:else:">performIfCan: selector with: aObject with: bObject with: cObject else: block 
	^self 
		performIfCan: selector
		withArguments: (Array 
				with: aObject
				with: bObject
				with: cObject)
		else: block</body>
</methods>

<methods>
<class-id>Core.Timestamp</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="addMinutes:">addMinutes: aMinuteCount 
	^self addSeconds: aMinuteCount * 60</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="nonconvexPolygon">nonconvexPolygon
	| controlPoints weights knots |
	controlPoints := Array new: 5.
	controlPoints at: 1 put: 0.1 , 0.1.
	controlPoints at: 2 put: 0.9 , 0.1.
	controlPoints at: 3 put: 0.25 , 0.25.
	controlPoints at: 4 put: 0.1 , 0.9.
	controlPoints at: 5 put: 0.1 , 0.1.
	weights := Array new: 5.
	weights at: 1 put: 1.0.
	weights at: 2 put: 1.0.
	weights at: 3 put: 1.0.
	weights at: 4 put: 1.0.
	weights at: 5 put: 1.0.
	knots := #(0 0 1 2 3 4 4).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLPerspectiveProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="viewYupXleft">viewYupXleft
	| rFeyeF rFfocusF reyefocus ufocuseyeF rFupF |
	rFeyeF := self rFeyeF.
	rFfocusF := self rFfocusF.
	reyefocus := (rFfocusF - rFeyeF) length.
	ufocuseyeF := StCAD.StMath.StMFullColumn 
				with: 0.0d
				with: 0.0d
				with: -1.0d.
	rFeyeF := rFfocusF plusFullColumn: ufocuseyeF times: reyefocus.
	rFupF := StCAD.StMath.StMFullColumn 
				with: 0.0d
				with: 1.0d
				with: 0.0d.
	self rFeyeF: rFeyeF.
	self rFupF: rFupF</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjector</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="viewYupXright">viewYupXright
	projection viewYupXright</body>
</methods>

<methods>
<class-id>Jun.Jun3dPoint</class-id> <category>CADSM</category>

<body package="Jun-Geometry-Basic" selector="asFullColumn">asFullColumn
	^StCAD.StMath.StMFullColumn 
		with: x
		with: y
		with: z</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example6Kohee">example6Kohee
	"JunOpenGL3dNurbsSurface example6Kohee."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsCylSurface.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1.0 @ 1.0).
	nurbs addTrimCurve: trimCurve.
	trimCurve := JunOpenGL2dTrimNurbsCurve nonconvexPolygon reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="controlPoints">controlPoints
	"Answers anArray that contains my control points."

	^controlPoints copy</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="middle">middle
	self emptyCheck.
	^self at: self size // 2 + 1</body>
</methods>

<methods>
<class-id>Jun.JunSystem class</class-id> <category>about</category>

<body package="Jun-System-Support" selector="aboutForSeconds:">aboutForSeconds: seconds 
	"Do nothing."</body>
</methods>

<methods>
<class-id>Jun.JunColorChoiceModel class</class-id> <category>CADSM</category>

<body package="Jun-Goodies-Color" selector="installColorBarsAndPlates">installColorBarsAndPlates
	| filepath readStream bos |
	(bars isNil or: [bars first palette ~= Screen default colorPalette]) 
		ifTrue: 
			[
			[filepath := (Filename fromComponents: #('resource')) construct: 'bars.bos'.
			readStream := filepath asFilename readStream.
			
			[bos := BinaryObjectStorage onOldNoScan: readStream.
			bars := bos contents at: 1.
			bars first palette ~= Screen default colorPalette 
				ifTrue: [self error: 'Palettes do not match.']] 
					ensure: [readStream close]] 
					on: Error
					do: 
						[:ex | 
						self initializeBars.
						bos := BinaryObjectStorage onNew: filepath asFilename writeStream.
						[bos nextPut: bars] ensure: [bos close].
						ex return]].
	(plates isNil or: [plates first palette ~= Screen default colorPalette]) 
		ifTrue: 
			[
			[filepath := (Filename fromComponents: #('resource')) 
						construct: 'plates.bos'.
			readStream := filepath asFilename readStream.
			
			[bos := BinaryObjectStorage onOldNoScan: readStream.
			plates := bos contents at: 1.
			plates first palette ~= Screen default colorPalette 
				ifTrue: [self error: 'Palettes do not match.']] 
					ensure: [readStream close]] 
					on: Error
					do: 
						[:ex | 
						self initializePlates.
						bos := BinaryObjectStorage onNew: filepath asFilename writeStream.
						[bos nextPut: plates] ensure: [bos close].
						ex return]]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="rFeyeF">rFeyeF
	^eyePoint asFullColumn</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="center:radius:">center: centerPoint radius: radius 
	"JunOpenGL2dTrimNurbsCurve center: 1.0d@1.0d radius: 1.0d"

	| xCenter yCenter controlPoints weights knots |
	xCenter := centerPoint x.
	yCenter := centerPoint y.
	controlPoints := Array new: 9.
	controlPoints at: 1 put: xCenter + 0 , (yCenter - radius) , 0.
	controlPoints at: 2 put: xCenter + radius , (yCenter - radius) , 0.
	controlPoints at: 3 put: xCenter + radius , (yCenter + 0) , 0.
	controlPoints at: 4 put: xCenter + radius , (yCenter + radius) , 0.
	controlPoints at: 5 put: xCenter + 0 , (yCenter + radius) , 0.
	controlPoints at: 6 put: xCenter - radius , (yCenter + radius) , 0.
	controlPoints at: 7 put: xCenter - radius , (yCenter + 0) , 0.
	controlPoints at: 8 put: xCenter - radius , (yCenter - radius) , 0.
	controlPoints at: 9 put: xCenter + 0 , (yCenter - radius) , 0.
	weights := Array new: 9.
	weights at: 1 put: 1.0d.
	weights at: 2 put: 1 / 2.0d sqrt.
	weights at: 3 put: 1.0d.
	weights at: 4 put: 1 / 2.0d sqrt.
	weights at: 5 put: 1.0d.
	weights at: 6 put: 1 / 2.0d sqrt.
	weights at: 7 put: 1.0d.
	weights at: 8 put: 1 / 2.0d sqrt.
	weights at: 9 put: 1.0d.
	knots := #(0 0 0 1 1 2 2 3 3 4 4 4).
	knots := knots collect: [:knot | knot asDouble / 4].
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjector</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="viewYupXleft">viewYupXleft
	projection viewYupXleft</body>
</methods>

<methods>
<class-id>RuntimePackager.RuntimeManager</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="startupApplication">startupApplication
	CADSM.UI.RegistrationDialog startUp.
	Parcel loadParcelFrom: (ObjectMemory imagePrefix , '.pcl') asFilename</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Koh">example5Koh
	"JunOpenGL3dNurbsSurface example5Koh."

	| nurbs points trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsSurface.
	points := Array new: 5.
	points at: 1 put: -0.5 , -0.5.
	points at: 2 put: 1.5 , -0.5.
	points at: 3 put: 1.5 , 1.5.
	points at: 4 put: -0.5 , 1.5.
	points at: 5 put: -0.5 , -0.5.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points.
	nurbs addTrimCurve: trimCurve.
	points := Array new: 5.
	points at: 1 put: 0.1 , 0.1.
	points at: 2 put: 0.5 , 0.1.
	points at: 3 put: 0.5 , 0.5.
	points at: 4 put: 0.1 , 0.5.
	points at: 5 put: 0.1 , 0.1.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points reverse.
	nurbs addTrimCurve: trimCurve.
	points := Array new: 5.
	points at: 1 put: 0.2 , 0.2.
	points at: 2 put: 0.4 , 0.2.
	points at: 3 put: 0.4 , 0.4.
	points at: 4 put: 0.2 , 0.4.
	points at: 5 put: 0.2 , 0.2.
	trimCurve := JunOpenGL2dTrimPolylineLoop points: points.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="renderOn:with:for:">renderOn: aRenderingContext with: aJunOpenGLNurbsSurface for: aNurbsHandle 
	"Modified by A-S Koh."

	aRenderingContext trimNurbsCurve: self for: aNurbsHandle</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohee">example5Kohee
	"JunOpenGL3dNurbsSurface example5Kohee."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsCylSurface.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1.0 @ 1.0).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve center: 0.5d @ 0.5d radius: 0.25d) 
				reverse.
	nurbs addTrimCurve: trimCurve.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.4 @ 0.4 corner: 0.6 @ 0.6).
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="with:parallelCollect:">with: aCollection parallelCollect: aBlock 
	| n newCollection |
	(n := self size) == aCollection size 
		ifFalse: [self error: #'Parallel collections should match.' &lt;&lt; #koh].
	newCollection := self species withSize: n.
	1 to: n
		do: 
			[:i | 
			newCollection at: i
				put: (aBlock value: (self at: i) value: (aCollection at: i))].
	^newCollection</body>
</methods>

<methods>
<class-id>Core.Array</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="conditionSelfVectorWithTol:">conditionSelfVectorWithTol: tol 
	| element |
	1 to: self size
		do: 
			[:i | 
			element := self at: i.
			element &lt; 0.0d ifTrue: [element := 0.0d - element].
			element &lt; tol ifTrue: [self at: i put: 0.0d]]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimPolylineLoop</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="originalrenderOn:with:for:">originalrenderOn: aRenderingContext with: aJunOpenGLNurbsSurface for: aNurbsHandle 
	| array uMin vMin uMax vMax uWidth vWidth |
	uMin := aJunOpenGLNurbsSurface uKnotAt: aJunOpenGLNurbsSurface uOrder.
	vMin := aJunOpenGLNurbsSurface vKnotAt: aJunOpenGLNurbsSurface vOrder.
	uMax := aJunOpenGLNurbsSurface uKnotAt: aJunOpenGLNurbsSurface uSize + 1.
	vMax := aJunOpenGLNurbsSurface vKnotAt: aJunOpenGLNurbsSurface vSize + 1.
	uWidth := uMax - uMin.
	vWidth := vMax - vMin.
	array := Array new: points size + 1 * 3.
	1 to: points size
		do: 
			[:index | 
			| point |
			point := points at: index.
			array at: index * 3 - 2 put: (point x * uWidth + uMin) asFloat.
			array at: index * 3 - 1 put: (point y * vWidth + vMin) asFloat.
			array at: index * 3 put: 1.0].
	array at: points size * 3 + 1 put: (points first x * uWidth + uMin) asFloat.
	array at: points size * 3 + 2 put: (points first y * vWidth + vMin) asFloat.
	array at: points size * 3 + 3 put: 1.0.
	aRenderingContext trimPolyline: array for: aNurbsHandle</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="when:ask:perform:with:">when: eventName ask: anObject perform: selector with: argument 
	self
		when: eventName
		send: selector
		to: anObject
		with: argument</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="exampleTopSemiCircle">exampleTopSemiCircle
	"JunOpenGL2dTrimNurbsCurve exampleTopSemiCircle"

	| controlPoints weights knots |
	controlPoints := Array new: 3.
	controlPoints at: 1 put: 1 , 0 , 0.
	controlPoints at: 2 put: 0 , 1 , 0.
	controlPoints at: 3 put: -1 , 0 , 0.
	weights := Array new: 3.
	weights at: 1 put: 1.0d.
	weights at: 2 put: 0.0d.
	weights at: 3 put: 1.0d.
	knots := #(0 0 0 1 1 1).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Core.Date</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="addYears:">addYears: yearCount 
	| newYear newIsLeapYear newDay |
	newYear := year + yearCount.
	newIsLeapYear := (self class leapYear: newYear) == 1.
	newDay := day.
	self isAfterFebruary28 
		ifTrue: 
			[self isLeapYear 
				ifTrue: [newIsLeapYear ifFalse: [newDay := day - 1]]
				ifFalse: [newIsLeapYear ifTrue: [newDay := day + 1]]].
	^self class newDay: newDay year: newYear</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsSurface">exampleNurbsSurface
	"JunOpenGL3dNurbsSurface exampleNurbsSurface show."

	| controlPoints weights knots |
	controlPoints := JunMatrix new: 4.
	1 to: 4 do: [:x | 1 to: 4 do: [:y | controlPoints atPoint: x @ y put: (Jun3dPoint
					x: x - 2.5 * 2 / 3
					y: y - 2.5 * 2 / 3
					z: (((x = 2 or: [x = 3])
							and: [y = 2 or: [y = 3]])
							ifTrue: [1]
							ifFalse: [-1]))]].
	weights := JunMatrix new: 4 collection: ((1 to: 16)
					collect: [:i | i // 4 + 1 / 2.0]).
	knots := #(0.0 0.0 0.5 0.5 1.0 1.0 1.0 1.0).
	^JunOpenGL3dNurbsSurface
		controlPoints: (JunMatrix new: 4 collection: controlPoints)
		weights: weights
		uKnotVector: knots
		vKnotVector: knots</body>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsRectSurface2">exampleNurbsRectSurface2
	"JunOpenGL3dNurbsSurface exampleNurbsRectSurface2 name: 'example'; paint: ColorValue blue; show."

	| xLength yLength controlPoints weights knots |
	xLength := 2.0d.
	yLength := 3.0d.
	controlPoints := JunMatrix new: 2.
	controlPoints atPoint: 1 @ 1
		put: (Jun3dPoint 
				x: 0.0d
				y: 0.0d
				z: 0.0d).
	controlPoints atPoint: 1 @ 2
		put: (Jun3dPoint 
				x: 0.0d
				y: yLength
				z: 0.0d).
	controlPoints atPoint: 2 @ 1
		put: (Jun3dPoint 
				x: xLength
				y: 0.0d
				z: 0.0d).
	controlPoints atPoint: 2 @ 2
		put: (Jun3dPoint 
				x: xLength
				y: yLength
				z: 0.0d).
	weights := JunMatrix new: 2
				collection: ((1 to: 2 * 2) collect: [:i | 1.0d]).
	knots := #(0 0 1 1).
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: knots copy
		vKnotVector: knots copy</body>
</methods>

<methods>
<class-id>Core.Collection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="printVerboseOn:">printVerboseOn: aStream 
	| tooMany |
	tooMany := aStream position + self maxPrint.
	aStream
		print: self class;
		nextPutAll: ' ('.
	self do: 
			[:element | 
			aStream
				cr;
				cr.
			aStream position &gt; tooMany 
				ifTrue: 
					[aStream nextPutAll: (#etc &lt;&lt; #dialogs &gt;&gt; '...etc...') asString , ')'.
					^self].
			element printVerboseOn: aStream].
	aStream
		cr;
		nextPut: $)</body>
</methods>

<methods>
<class-id>Security.RSA</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="encryptLong:">encryptLong: aMessageByteArray 
	| nByte aRSALengthLimit cByteArray |
	nByte := publicKey n digitLength.
	aRSALengthLimit := nByte - 11.
	cByteArray := aMessageByteArray breakIntoSizeOf: aRSALengthLimit.
	^(cByteArray collect: [:aByteArray | self encryptRSAES: aByteArray]) 
		concatenateCollections</body>
</methods>

<methods>
<class-id>Jun.JunNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-Geometry-Curves" selector="exampleKoh1">exampleKoh1
	"self exampleKoh1"

	| aNurbCurve |
	aNurbCurve := self exampleBSplineCurve.
	aNurbCurve atT: 0.5d</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="performIfCan:else:">performIfCan: selector else: block 
	^self 
		performIfCan: selector
		withArguments: Array new
		else: block</body>
</methods>

<methods>
<class-id>Core.Timestamp</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="addDays:">addDays: dayCount 
	| aDate aTime |
	aDate := self asDate.
	aTime := self asTime.
	^self class fromDate: (aDate addDays: dayCount) andTime: aTime</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="exampleCircle">exampleCircle
	"JunOpenGL2dTrimNurbsCurve exampleCircle"

	| controlPoints weights knots |
	controlPoints := Array new: 9.
	controlPoints at: 1 put: 0 , -1 , 0.
	controlPoints at: 2 put: 1 , -1 , 0.
	controlPoints at: 3 put: 1 , 0 , 0.
	controlPoints at: 4 put: 1 , 1 , 0.
	controlPoints at: 5 put: 0 , 1 , 0.
	controlPoints at: 6 put: -1 , 1 , 0.
	controlPoints at: 7 put: -1 , 0 , 0.
	controlPoints at: 8 put: -1 , -1 , 0.
	controlPoints at: 9 put: 0 , -1 , 0.
	weights := Array new: 9.
	weights at: 1 put: 1.0d.
	weights at: 2 put: 1 / 2.0d sqrt.
	weights at: 3 put: 1.0d.
	weights at: 4 put: 1 / 2.0d sqrt.
	weights at: 5 put: 1.0d.
	weights at: 6 put: 1 / 2.0d sqrt.
	weights at: 7 put: 1.0d.
	weights at: 8 put: 1 / 2.0d sqrt.
	weights at: 9 put: 1.0d.
	knots := #(0 0 0 1 1 2 2 3 3 4 4 4).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Core.Date</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="subtractYears:">subtractYears: yearCount 
	| newYear newIsLeapYear newDay |
	newYear := year - yearCount.
	newIsLeapYear := (self class leapYear: newYear) == 1.
	newDay := day.
	self isAfterFebruary28 
		ifTrue: 
			[self isLeapYear 
				ifTrue: [newIsLeapYear ifFalse: [newDay := day - 1]]
				ifFalse: [newIsLeapYear ifTrue: [newDay := day + 1]]].
	^self class newDay: newDay year: newYear</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLRenderingContext</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Support" selector="trimNurbsCurve:for:">trimNurbsCurve: aNurbsCurve for: aNurbsHandle 
	| knotVector controlPoints weights floatArray |
	knotVector := aNurbsCurve knotVector collect: [:each | each asFloat].
	controlPoints := aNurbsCurve controlPoints.
	weights := aNurbsCurve weights.
	floatArray := WriteStream on: Array new.
	controlPoints with: weights
		do: 
			[:point :weight | 
			floatArray nextPut: (point x * weight) asFloat.
			floatArray nextPut: (point y * weight) asFloat.
			floatArray nextPut: weight asFloat].
	floatArray := floatArray contents.
	OpenGLInterface gluBeginTrim: aNurbsHandle.
	OpenGLInterface 
		gluNurbsCurve: aNurbsHandle
		with: knotVector size
		with: (JunForeignHeap copyFloatArrayToGcHeap: knotVector)
		with: 3
		with: (JunForeignHeap copyFloatArrayToGcHeap: floatArray)
		with: aNurbsCurve order
		with: OpenGLInterface GLU_MAP1_TRIM_3.
	OpenGLInterface gluEndTrim: aNurbsHandle</body>
</methods>

<methods>
<class-id>Security.RSAKey</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="minByteLengthOfMessage">minByteLengthOfMessage
	^0</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="setKnotVector:controlPoints:weights:">setKnotVector: knotArray controlPoints: controlPointArray weights: weightArray 
	knotVector := knotArray.
	controlPoints := controlPointArray.
	weights := weightArray</body>
</methods>

<methods>
<class-id>UI.ScrollWrapper</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="scrollOriginal:">scrollOriginal: aPoint
 	"Scroll the receiver by aPoint."

	| maximumAmount minimumAmount amount |
	maximumAmount := self scrollOffset + origin extraSpace origin max: 0@0. 
 	minimumAmount := self scrollOffset + self visibleExtent - self scrollableExtent min: 0@0.
	amount := (aPoint min: maximumAmount) max: minimumAmount.
 	amount ~= (0@0) ifTrue: 
		[self scrollBy: amount negated].
	^amount</body>
</methods>

<methods>
<class-id>Security.RSA</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="decryptLong:">decryptLong: aMessageByteArray 
	| nByte cByteArray |
	nByte := privateKey n digitLength.
	cByteArray := aMessageByteArray breakIntoSizeOf: nByte.
	^(cByteArray collect: [:aByteArray | self decryptRSAES: aByteArray]) 
		concatenateCollections</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="with:parallelDo:">with: aCollection parallelDo: aBlock 
	| n |
	(n := self size) == aCollection size 
		ifFalse: [self error: #'Parallel collections should match.' &lt;&lt; #koh].
	1 to: n do: [:i | aBlock value: (self at: i) value: (aCollection at: i)]</body>
</methods>

<methods>
<class-id>Core.Timestamp</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="addYears:">addYears: yearCount 
	| aDate aTime |
	aDate := self asDate.
	aTime := self asTime.
	^self class fromDate: (aDate addYears: yearCount) andTime: aTime</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="fromRectangle:">fromRectangle: aRectangle 
	"JunOpenGL2dTrimNurbsCurve fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1.0 @ 1.0)"

	| controlPoints weights knots |
	controlPoints := aRectangle asPointArray.
	weights := (Array new: 5)
				atAllPut: 1.0d;
				yourself.
	knots := #(0 0 1 2 3 4 4).
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Core.Date</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="isLeapDay">isLeapDay
	^self isLeapYear and: [day == (31 + 29)]</body>
</methods>

<methods>
<class-id>Core.String</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="printVerboseOn:">printVerboseOn: aStream 
	self printOn: aStream</body>
</methods>

<methods>
<class-id>Security.RSAKey</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="maxByteLengthOfMessage">maxByteLengthOfMessage
	^n basicSize - 11</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsRectSurface">exampleNurbsRectSurface
	"JunOpenGL3dNurbsSurface exampleNurbsRectSurface name: 'example'; paint: ColorValue blue; show."

	| xLength yLength n dx dy controlPoints weights frontend backend middle knots |
	xLength := 2.0d.
	yLength := 3.0d.
	n := 2.
	dx := xLength / (n - 1).
	dy := yLength / (n - 1).
	controlPoints := JunMatrix new: n.
	1 to: 2
		do: 
			[:i | 
			1 to: 2
				do: 
					[:j | 
					controlPoints atPoint: i @ j
						put: (Jun3dPoint 
								x: (i - 1) * dx
								y: (j - 1) * dy
								z: 0.0d)]].
	weights := JunMatrix new: 2
				collection: ((1 to: n * n) collect: [:i | 1.0d]).
	frontend := (Array new: n - 1)
				atAllPut: 0.0d;
				yourself.
	backend := (Array new: n - 1)
				atAllPut: 1.0d;
				yourself.
	middle := Array with: 0.0d with: 1.0d.
	knots := frontend , middle , backend.
	^JunOpenGL3dNurbsSurface 
		controlPoints: (JunMatrix new: n collection: controlPoints)
		weights: weights
		uKnotVector: knots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="reverse">reverse
	^self class 
		controlPoints: controlPoints reverse
		weights: weights reverse
		knotVector: (knotVector collect: [:knot | knot negated]) reverse</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsCylSurface">exampleNurbsCylSurface
	"JunOpenGL3dNurbsSurface exampleNurbsCylSurface name: 'example'; paint: ColorValue blue; show."

	| n circleNurbs zEnd circleControlPoints controlPoints circleWeights weights point frontend backend middle knots circleKnots uMax |
	n := 2.
	circleNurbs := JunOpenGL3dNurbsCurve exampleCircle.
	zEnd := 2.0d.
	circleControlPoints := circleNurbs controlPoints.
	controlPoints := JunMatrix new: circleControlPoints size by: n.
	circleWeights := circleNurbs weights.
	weights := JunMatrix new: circleControlPoints size by: n.
	1 to: circleControlPoints size
		do: 
			[:i | 
			1 to: n
				do: 
					[:j | 
					point := (circleControlPoints at: i) copy.
					j == 2 ifTrue: [point setZ: zEnd].
					controlPoints atPoint: i @ j put: point.
					weights atPoint: i @ j put: (circleWeights at: i)]].
	circleKnots := circleNurbs knotVector.
	uMax := circleKnots last.
	circleKnots := circleKnots collect: [:knot | knot asDouble / uMax].
	frontend := (Array new: n - 1)
				atAllPut: 0.0d;
				yourself.
	backend := (Array new: n - 1)
				atAllPut: 1.0d;
				yourself.
	middle := Array with: 0.0d with: 1.0d.
	knots := frontend , middle , backend.
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: circleKnots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="breakIntoSizeOf:">breakIntoSizeOf: newSize 
	"No padding is done to the tail piece."

	| selfSize nWholePiece remainder cPiece start |
	selfSize := self size.
	nWholePiece := selfSize // newSize.
	remainder := selfSize \\ newSize.
	cPiece := OrderedCollection new: nWholePiece + 1.
	start := 1.
	1 to: nWholePiece
		do: 
			[:index | 
			| newPiece end |
			end := start + newSize - 1.
			newPiece := self copyFrom: start to: end.
			cPiece add: newPiece.
			start := end + 1].
	remainder &gt; 0 ifTrue: [cPiece add: (self copyFrom: start to: selfSize)].
	^cPiece</body>
</methods>

<methods>
<class-id>Jun.Jun3dBoundingBox</class-id> <category>CADSM</category>

<body package="Jun-Geometry-Boundaries" selector="vertexes">vertexes
	| cVertex |
	cVertex := OrderedCollection new: 10.
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: origin y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: origin y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: corner y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: origin y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: corner y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: corner y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: origin y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: corner y
				with: origin z).
	^cVertex</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="equality:">equality: aObject 
	"Testing an alternative for Object&gt;&gt;="

	"Replace 'equality:' with '=' if this method is suitable for a subclass."

	^self == aObject or: 
			[self class == aObject class and: 
					[self basicSize == aObject basicSize and: 
							[1 to: self class instSize
								do: [:i | ((self instVarAt: i) equality: (aObject instVarAt: i)) ifFalse: [^false]].
							1 to: self basicSize
								do: [:i | ((self at: i) equality: (aObject at: i)) ifFalse: [^false]].
							true]]]</body>
</methods>

<methods>
<class-id>Tools.Differator class</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="newOnFile:and:">newOnFile: aFilename and: bFilename 
	| block |
	block := 
			[:argFilename | 
			| aStream aText |
			aStream := argFilename asFilename readStream.
			[aText := aStream contents] ensure: [aStream close].
			aText].
	^self newOn: (block value: aFilename) and: (block value: bFilename)</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsSurface3">exampleNurbsSurface3
	"JunOpenGL3dNurbsSurface exampleNurbsSurface3 name: 'example'; paint: ColorValue blue; show."

	| n circleNurbs zEnd circleControlPoints controlPoints circleWeights weights point frontend backend middle knots circleKnots |
	n := 2.
	circleNurbs := JunOpenGL3dNurbsCurve exampleEllipseHalf.
	zEnd := 2.0d.
	circleControlPoints := circleNurbs controlPoints.
	controlPoints := JunMatrix new: circleControlPoints size by: n.
	circleWeights := circleNurbs weights.
	weights := JunMatrix new: circleControlPoints size by: n.
	1 to: circleControlPoints size
		do: 
			[:i | 
			1 to: n
				do: 
					[:j | 
					point := (circleControlPoints at: i) copy.
					j == 2 ifTrue: [point setZ: zEnd].
					controlPoints atPoint: i @ j put: point.
					weights atPoint: i @ j put: (circleWeights at: i)]].
	circleKnots := circleNurbs knotVector.
	frontend := (Array new: n - 1)
				atAllPut: 0.0d;
				yourself.
	backend := (Array new: n - 1)
				atAllPut: 1.0d;
				yourself.
	middle := Array with: 0.0d with: 1.0d.
	knots := frontend , middle , backend.
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: circleKnots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="knotVector">knotVector
	"Answer an Array that contains my knots."

	^knotVector copy</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohf">example5Kohf
	"JunOpenGL3dNurbsSurface example5Kohf."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1 @ 1).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.3 @ 0.3 corner: 0.6 @ 0.6)) 
					reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="replaceFrom:withCyclic:from:to:">replaceFrom: start withCyclic: replacement from: repStart to: repStop 
	^repStart &lt;= repStop 
		ifTrue: 
			[self 
				replaceFrom: start
				to: start + repStop - repStart
				with: replacement
				startingAt: repStart]
		ifFalse: 
			["Copy to the end, cycle to the beginning and continue copying to repStop"

			| repSize startPLUSrepSizeMINUSrepStart |
			repSize := replacement size.
			startPLUSrepSizeMINUSrepStart := start + repSize - repStart.
			self 
				replaceFrom: start
				to: startPLUSrepSizeMINUSrepStart
				with: replacement
				startingAt: repStart.
			self 
				replaceFrom: startPLUSrepSizeMINUSrepStart + 1
				to: startPLUSrepSizeMINUSrepStart + repStop
				with: replacement
				startingAt: 1]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGLProjection</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Projection" selector="rFfocusF">rFfocusF
	^sightPoint asFullColumn</body>
</methods>

<methods>
<class-id>Jun.Jun3dBoundingBox</class-id> <category>CADSM</category>

<body package="Jun-Geometry-Boundaries" selector="cVertex">cVertex
	| cVertex |
	cVertex := OrderedCollection new: 10.
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: origin y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: origin y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: corner y
				with: origin z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: origin y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: corner y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: origin x
				with: corner y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: origin y
				with: corner z).
	cVertex add: (StCAD.StMath.StMFullColumn 
				with: corner x
				with: corner y
				with: origin z).
	^cVertex</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="performIfCan:with:with:else:">performIfCan: selector with: aObject with: bObject else: block 
	^self 
		performIfCan: selector
		withArguments: (Array with: aObject with: bObject)
		else: block</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="start:end:ustart:uend:">start: startPoint end: endPoint ustart: ustart uend: uend 
	"JunOpenGL2dTrimNurbs start: 0 @ 0 end: 1.0 @ 1.0 ustart: 0 uend: 1"

	| controlPoints weights knots |
	controlPoints := Array with: startPoint with: endPoint.
	weights := (Array new: 2)
				atAllPut: 1.0d;
				yourself.
	knots := Array 
				with: ustart
				with: ustart
				with: uend
				with: uend.
	^JunOpenGL2dTrimNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Core.Date</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="isAfterFebruary28">isAfterFebruary28
	^day &gt; (31 + 28)</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="example5Kohf2">example5Kohf2
	"JunOpenGL3dNurbsSurface example5Kohf2."

	| nurbs trimCurve |
	nurbs := JunOpenGL3dNurbsSurface exampleNurbsRectSurface2.
	trimCurve := JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1 @ 1).
	nurbs addTrimCurve: trimCurve.
	trimCurve := (JunOpenGL2dTrimNurbsCurve 
				fromRectangle: (Graphics.Rectangle origin: 0.3 @ 0.3 corner: 0.5 @ 0.5)) 
					reverse.
	nurbs addTrimCurve: trimCurve.
	nurbs name: 'example'.
	nurbs paint: ColorValue blue.
	nurbs show.
	^nurbs</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsCurve class</class-id> <category>examples</category>

<body package="Jun-OpenGL-Objects" selector="exampleRectangle">exampleRectangle
	"JunOpenGL3dNurbsCurve exampleRectangle paint: ColorValue red; show."

	| controlPoints weights knots |
	controlPoints := Array new: 5.
	controlPoints at: 1 put: 0 , 0 , 0.
	controlPoints at: 2 put: 1 , 0 , 0.
	controlPoints at: 3 put: 1 , 1 , 0.
	controlPoints at: 4 put: 0 , 1 , 0.
	controlPoints at: 5 put: 0 , 0 , 0.
	weights := Array new: 5.
	weights at: 1 put: 1.0.
	weights at: 2 put: 1.0.
	weights at: 3 put: 1.0.
	weights at: 4 put: 1.0.
	weights at: 5 put: 1.0.
	knots := #(0 0 1 2 3 4 4).
	^JunOpenGL3dNurbsCurve 
		controlPoints: controlPoints
		weights: weights
		knotVector: knots</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="fromRectangle:">fromRectangle: aRectangle 
	"JunOpenGL3dNurbsSurface fromRectangle: (Graphics.Rectangle origin: 0 @ 0 corner: 1.0 @ 1.0)."

	| minxminy maxxmaxy controlPoints weights knots |
	minxminy := aRectangle origin.
	maxxmaxy := aRectangle corner.
	controlPoints := JunMatrix new: 2.
	controlPoints atPoint: 1 @ 1
		put: (Jun3dPoint 
				x: minxminy x
				y: minxminy y
				z: 0.0d).
	controlPoints atPoint: 1 @ 2
		put: (Jun3dPoint 
				x: minxminy x
				y: maxxmaxy y
				z: 0.0d).
	controlPoints atPoint: 2 @ 1
		put: (Jun3dPoint 
				x: maxxmaxy x
				y: minxminy y
				z: 0.0d).
	controlPoints atPoint: 2 @ 2
		put: (Jun3dPoint 
				x: maxxmaxy x
				y: maxxmaxy y
				z: 0.0d).
	weights := JunMatrix new: 2
				collection: ((1 to: 2 * 2) collect: [:i | 1.0d]).
	knots := #(0 0 1 1).
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: knots copy
		vKnotVector: knots copy</body>
</methods>

<methods>
<class-id>Core.Array</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="conditionSelfWithTol:">conditionSelfWithTol: tol 
	(self at: 1) isReal
		ifTrue: [self conditionSelfVectorWithTol: tol]
		ifFalse: [1 to: self size do: [:i | (self at: i)
					conditionSelfWithTol: tol]]</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimPolylineLoop</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="kohrenderOn:with:for:">kohrenderOn: aRenderingContext with: aJunOpenGLNurbsSurface for: aNurbsHandle 
	"Modified by A-S Koh."

	| array |
	array := Array new: points size * 3.
	1 to: points size
		do: 
			[:index | 
			| point |
			point := points at: index.
			array at: index * 3 - 2 put: point x asFloat.
			array at: index * 3 - 1 put: point y asFloat.
			array at: index * 3 put: 1.0].
	aRenderingContext trimPolyline: array for: aNurbsHandle</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="when:ask:perform:withArguments:">when: eventName ask: anObject perform: selector withArguments: argumentList 
	self 
		when: eventName
		send: selector
		to: anObject
		withArguments: argumentList</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="controlPoints:weights:knotVector:">controlPoints: anArrayOfPoints weights: anArrayOfNumber1 knotVector: anArrayOfNumber2 
	^self new 
		controlPoints: anArrayOfPoints
		weights: anArrayOfNumber1
		knotVector: anArrayOfNumber2</body>
</methods>

<methods>
<class-id>Core.Date</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="isLeapYear">isLeapYear
	^self leap == 1</body>
</methods>

<methods>
<class-id>Core.Stream</class-id> <category>CADSM</category>

<body package="CADSM-Misc" selector="printVerbose:">printVerbose: anObject 
	"Have anObject print on the receiver."

	anObject printVerboseOn: self</body>
</methods>

<methods>
<class-id>Security.RSAKey</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="postCopy">postCopy
	super postCOPY</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsCylSurface2">exampleNurbsCylSurface2
	"JunOpenGL3dNurbsSurface exampleNurbsCylSurface name: 'example'; paint: ColorValue blue; show."

	| n circleNurbs zEnd circleControlPoints controlPoints circleWeights weights point frontend backend middle knots circleKnots uMax |
	n := 2.
	circleNurbs := JunOpenGL3dNurbsCurve exampleCircle.
	zEnd := 2.0d.
	circleControlPoints := circleNurbs controlPoints.
	controlPoints := JunMatrix new: circleControlPoints size by: n.
	circleWeights := circleNurbs weights.
	weights := JunMatrix new: circleControlPoints size by: n.
	1 to: circleControlPoints size
		do: 
			[:i | 
			1 to: n
				do: 
					[:j | 
					point := (circleControlPoints at: i) copy.
					j == 2 ifTrue: [point setZ: zEnd].
					controlPoints atPoint: i @ j put: point.
					weights atPoint: i @ j put: (circleWeights at: i)]].
	circleKnots := circleNurbs knotVector.
	uMax := 1.
	circleKnots := circleKnots collect: [:knot | knot asDouble / uMax].
	frontend := (Array new: n - 1)
				atAllPut: 0.0d;
				yourself.
	backend := (Array new: n - 1)
				atAllPut: 1.0d;
				yourself.
	middle := Array with: 0.0d with: 1.0d.
	knots := frontend , middle , backend.
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: circleKnots
		vKnotVector: knots</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="when:ask:perform:">when: anEventNameSymbol ask: anObject perform: aSelectorSymbol 
	"same as when:send:to:"

	| arguments |
	aSelectorSymbol isSymbol 
		ifFalse: [^self errorBadSelector: aSelectorSymbol].
	arguments := Array 
				new: (MessageSend numberOfArgumentsFor: aSelectorSymbol).
	self when: anEventNameSymbol
		evaluate: (MessageSend 
				receiver: anObject
				selector: aSelectorSymbol
				arguments: arguments)</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL2dTrimNurbsCurve</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Trim" selector="weights">weights
	"Answer an Array of my weight map of control points."

	^weights copy</body>
</methods>

<methods>
<class-id>Jun.JunOpenGL3dNurbsSurface class</class-id> <category>CADSM</category>

<body package="Jun-OpenGL-Objects" selector="exampleNurbsRectSurface2a">exampleNurbsRectSurface2a
	"JunOpenGL3dNurbsSurface exampleNurbsRectSurface2a name: 'example'; paint: ColorValue blue; show."

	| xLength yLength controlPoints weights knots |
	xLength := 2.0d.
	yLength := 3.0d.
	controlPoints := JunMatrix new: 2.
	controlPoints atPoint: 1 @ 1
		put: (Jun3dPoint 
				x: xLength
				y: 0.0d
				z: 0.0d).
	controlPoints atPoint: 1 @ 2
		put: (Jun3dPoint 
				x: xLength
				y: yLength
				z: 0.0d).
	controlPoints atPoint: 2 @ 1
		put: (Jun3dPoint 
				x: 0.0d
				y: 0.0d
				z: 0.0d).
	controlPoints atPoint: 2 @ 2
		put: (Jun3dPoint 
				x: 0.0d
				y: yLength
				z: 0.0d).
	weights := JunMatrix new: 2
				collection: ((1 to: 2 * 2) collect: [:i | 1.0d]).
	knots := #(0 0 1 1).
	^JunOpenGL3dNurbsSurface 
		controlPoints: controlPoints
		weights: weights
		uKnotVector: knots copy
		vKnotVector: knots copy</body>
</methods>

<methods>
<class-id>Core.SequenceableCollection</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="concatenateCollections">concatenateCollections
	"Receiver is a collection of similar collections. Return the concatenated collection."

	| totalSize answer start |
	totalSize := self inject: 0 into: [:subTotal :next | subTotal + next size].
	answer := (self at: 1) species withSize: totalSize.
	start := 1.
	self do: 
			[:aCollection | 
			| end |
			end := start + aCollection size - 1.
			answer 
				replaceFrom: start
				to: end
				with: aCollection
				startingAt: 1.
			start := end + 1].
	^answer</body>
</methods>

<methods>
<class-id>Core.Object</class-id> <category>koh</category>

<body package="CADSM-Misc" selector="performIfCan:with:else:">performIfCan: selector with: aObject else: block 
	^self 
		performIfCan: selector
		withArguments: (Array with: aObject)
		else: block</body>

<body package="CADSM-Misc" selector="when:ask:perform:with:with:">when: eventName ask: anObject perform: selector with: firstArgument with: secondArgument 
	self
		when: eventName
		send: selector
		to: anObject
		with: firstArgument
		with: secondArgument</body>
</methods>

<do-it>"Imported Classes:"</do-it>

<do-it>self error: 'Attempting to file-in parcel imports.  Choose terminate or close'</do-it>

<class>
<name>Object</name>
<environment>Core</environment>
<super></super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Kernel-Objects</category>
<attributes>
<package>Kernel-Objects</package>
</attributes>
</class>

<class>
<name>Date</name>
<environment>Core</environment>
<super>Core.Magnitude</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>day year </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Magnitude-General</category>
<attributes>
<package>Magnitude-General</package>
</attributes>
</class>

<class>
<name>JunOpenGLRetainedMedium</name>
<environment>Jun</environment>
<super>Jun.JunOpenGLResource</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>medium extent </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Support</category>
<attributes>
<package>Jun-OpenGL-Support</package>
</attributes>
</class>

<class>
<name>RuntimeManager</name>
<environment>RuntimePackager</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>RuntimePackager</category>
<attributes>
<package>RuntimePackager</package>
</attributes>
</class>

<class>
<name>Jun3dPoint</name>
<environment>Jun</environment>
<super>Jun.JunPoint</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>x y z </inst-vars>
<class-inst-vars>enhancements </class-inst-vars>
<imports></imports>
<category>Jun-Geometry-Basic</category>
<attributes>
<package>Jun-Geometry-Basic</package>
</attributes>
</class>

<class>
<name>ScrollWrapper</name>
<environment>UI</environment>
<super>Graphics.TranslatingWrapper</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>dependents preferredBoundsBlock </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Interface-Support</category>
<attributes>
<package>Interface-Support</package>
</attributes>
</class>

<class>
<name>RSAKey</name>
<environment>Security</environment>
<super>Security.EncryptionKey</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>n </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Security-Ciphers</category>
<attributes>
<package>RSA</package>
</attributes>
</class>

<class>
<name>CADSMItem</name>
<environment>Smalltalk</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>CADSM-Basic</category>
<attributes>
<package>CADSM</package>
</attributes>
</class>

<class>
<name>JunOpenGL3dNonConvexPolygon</name>
<environment>Jun</environment>
<super>Jun.JunOpenGL3dVertexesObject</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>stipple texture holes triangles </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Objects</category>
<attributes>
<package>Jun-OpenGL-Objects</package>
</attributes>
</class>

<class>
<name>TextCollector</name>
<environment>UI</environment>
<super>UI.ValueHolder</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>entryStream characterLimit writeSequencer nextEntry autoFlush </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Interface-Support</category>
<attributes>
<package>Interface-Support</package>
</attributes>
</class>

<class>
<name>JunOpenGL2dTrimNurbsCurve</name>
<environment>Jun</environment>
<super>Jun.JunOpenGL2dTrimCurve</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>knotVector controlPoints weights </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Trim</category>
<attributes>
<package>Jun-OpenGL-Trim</package>
</attributes>
</class>

<class>
<name>Collection</name>
<environment>Core</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Collections-Abstract</category>
<attributes>
<package>Collections-Abstract</package>
</attributes>
</class>

<class>
<name>SequenceableCollection</name>
<environment>Core</environment>
<super>Core.Collection</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Collections-Abstract</category>
<attributes>
<package>Collections-Abstract</package>
</attributes>
</class>

<class>
<name>JunOpenGL2dTrimPolylineLoop</name>
<environment>Jun</environment>
<super>Jun.JunOpenGL2dTrimCurve</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>points </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Trim</category>
<attributes>
<package>Jun-OpenGL-Trim</package>
</attributes>
</class>

<class>
<name>TestCase</name>
<environment>XProgramming.SUnit</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>testSelector </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>SUnit</category>
<attributes>
<package>SUnit</package>
</attributes>
</class>

<class>
<name>Jun3dBoundingBox</name>
<environment>Jun</environment>
<super>Jun.JunBoundingBox</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-Geometry-Boundaries</category>
<attributes>
<package>Jun-Geometry-Boundaries</package>
</attributes>
</class>

<class>
<name>OrderedCollection</name>
<environment>Core</environment>
<super>Core.SequenceableCollection</super>
<private>false</private>
<indexed-type>objects</indexed-type>
<inst-vars>firstIndex lastIndex </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Collections-Sequenceable</category>
<attributes>
<package>Collections-Sequenceable</package>
</attributes>
</class>

<class>
<name>JunOpenGL3dNurbsSurface</name>
<environment>Jun</environment>
<super>Jun.JunOpenGL3dPrimitiveObject</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>stipple texture controlPoints uKnotVector vKnotVector weights trimCurves </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Objects</category>
<attributes>
<package>Jun-OpenGL-Objects</package>
</attributes>
</class>

<class>
<name>JunOpenGLProjector</name>
<environment>Jun</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>projection shading presentation lights lineSmoothBoolean polygonSmoothBoolean </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Projection</category>
<attributes>
<package>Jun-OpenGL-Projection</package>
</attributes>
</class>

<class>
<name>String</name>
<environment>Core</environment>
<super>Core.CharacterArray</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Collections-Text</category>
<attributes>
<package>Collections-Text</package>
</attributes>
</class>

<class>
<name>JunOpenGLRenderingContext</name>
<environment>Jun</environment>
<super>Jun.JunOpenGLResource</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>medium handle paint alpha lineWidth pointSize projection shading lightIndex lightStates nurbsSamplingTolerance presentation transformation texture textureCoordinateBlock textureCoordinateIndex depthMask lineStippleFactor lineStipplePattern polygonStipple lineSmooth polygonSmooth cullFace ambientLight lights materialAmbient materialDiffuse materialEmission materialShininess materialSpecular fogColor fogExpDensity fogExp2Density fogLinearDensity enableDisables viewport backgroundColor </inst-vars>
<class-inst-vars>enhancements </class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Support</category>
<attributes>
<package>Jun-OpenGL-Support</package>
</attributes>
</class>

<class>
<name>Stream</name>
<environment>Core</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports>
			private IOConstants.*
			</imports>
<category>Collections-Streams</category>
<attributes>
<package>Collections-Streams</package>
</attributes>
</class>

<class>
<name>LargeInteger</name>
<environment>Core</environment>
<super>Core.Integer</super>
<private>false</private>
<indexed-type>bytes</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Magnitude-Numbers</category>
<attributes>
<package>Magnitude-Numbers</package>
</attributes>
</class>

<class>
<name>RSA</name>
<environment>Security</environment>
<super>Security.AsymmetricCipher</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>privateKey publicKey hash </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Security-Ciphers</category>
<attributes>
<package>RSA</package>
</attributes>
</class>

<class>
<name>ScrollBarTracker</name>
<environment>UI</environment>
<super>UI.SelectionTracker</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>selector </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Interface-Events-Trackers</category>
<attributes>
<package>Interface-Events-Trackers</package>
</attributes>
</class>

<class>
<name>Array</name>
<environment>Core</environment>
<super>Core.ArrayedCollection</super>
<private>false</private>
<indexed-type>objects</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Collections-Arrayed</category>
<attributes>
<package>Collections-Arrayed</package>
</attributes>
</class>

<class>
<name>StMFullVector</name>
<environment>StCAD.StMath</environment>
<super>StCAD.StMath.StMArray</super>
<private>false</private>
<indexed-type>objects</indexed-type>
<inst-vars></inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>StMathArray</category>
<attributes>
<package>xMath</package>
</attributes>
</class>

<class>
<name>JunOpenGLProjection</name>
<environment>Jun</environment>
<super>Core.Object</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>eyePoint sightPoint upVector near far viewFactor </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Projection</category>
<attributes>
<package>Jun-OpenGL-Projection</package>
</attributes>
</class>

<class>
<name>JunOpenGLPerspectiveProjection</name>
<environment>Jun</environment>
<super>Jun.JunOpenGLProjection</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>fovy zoomHeight </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>Jun-OpenGL-Projection</category>
<attributes>
<package>Jun-OpenGL-Projection</package>
</attributes>
</class>

<class>
<name>Timestamp</name>
<environment>Core</environment>
<super>Core.Magnitude</super>
<private>false</private>
<indexed-type>none</indexed-type>
<inst-vars>year month day hour minute second millisecond </inst-vars>
<class-inst-vars></class-inst-vars>
<imports></imports>
<category>UIBasics-Support</category>
<attributes>
<package>UIBasics-Support</package>
</attributes>
</class>

</st-source>
