<commit_before>"
<keyClass>
A shape is a visual element meant to be displayed. Roassal offers numerous shapes, themselves highly configurable. The class `RSShape` is the root of all the Roassal shapes, and a shape is typically created by instantiating a subclass of `RSShape`. For example, a box is defined by instantiating `RSBox`. 

For example, a colored box with a thick border may be defined as:

```Smalltalk
box := RSBox new
			size: 80;
			color: #yellow;
			border: (RSBorder new color: #blue; width: 10).
```

Colors may be provided either as a color object (e.g., `Color blue` or `Color r: 0 g: 0 b: 1.0`) or as a symbol (e.g., `#yellow`). In case a symbol is provided, it is converted to a color object using `Color>>colorFrom:`, as in `Color>>colorFrom: #yellow`. 

Although most of the configuration may be carried out by directly sending an object with a literal (e.g., `size: 80`), part of the configuration of the shape may involve dedicated objects, such as `RSBorder`.

`RSShape` is the root of all the Roassal shapes. A shape represents a visual element meant to be inserted in a `RSCanvas`. `RSShape` is an abstract class, not meant to be directly instantiated therefore.

*Responsibility*: A shape, i.e., subclass of the class `RSShape` is responsible to model a visual element. 

*Collaborators*: A shape is meaningful when inserted in a canvas

*Variables*:
- `paint`: the color of the Athens paint object used to render the visual shape
- `path`: refers to AthensCairoPath, which is a resource of a foreign object, ie., the cairo on
- `border`:
- `parent`: the parent shape
- `isFixed`: a boolean indicating if the shape is fixed (ie., not subject to the camera position and movement)

"
Class {
	#name : #RSShape,
	#superclass : #RSObjectWithProperty,
	#instVars : [
		'paint',
		'path',
		'border',
		'parent',
		'isFixed',
		'encompassingRectangle',
		'model'
	],
	#category : #'Roassal3-Core'
}

{ #category : #accessing }
RSShape class >> model: anObject [
	"Create an instance of myself with anObject as model"
	^ self new model: anObject
]

{ #category : #adding }
RSShape >> accept: aVisitor [
	self subclassResponsibility 
]
<commit_msg>Added an handy method<commit_after>"
<keyClass>
A shape is a visual element meant to be displayed. Roassal offers numerous shapes, themselves highly configurable. The class `RSShape` is the root of all the Roassal shapes, and a shape is typically created by instantiating a subclass of `RSShape`. For example, a box is defined by instantiating `RSBox`. 

For example, a colored box with a thick border may be defined as:

```Smalltalk
box := RSBox new
			size: 80;
			color: #yellow;
			border: (RSBorder new color: #blue; width: 10).
```

Colors may be provided either as a color object (e.g., `Color blue` or `Color r: 0 g: 0 b: 1.0`) or as a symbol (e.g., `#yellow`). In case a symbol is provided, it is converted to a color object using `Color>>colorFrom:`, as in `Color>>colorFrom: #yellow`. 

Although most of the configuration may be carried out by directly sending an object with a literal (e.g., `size: 80`), part of the configuration of the shape may involve dedicated objects, such as `RSBorder`.

`RSShape` is the root of all the Roassal shapes. A shape represents a visual element meant to be inserted in a `RSCanvas`. `RSShape` is an abstract class, not meant to be directly instantiated therefore.

*Responsibility*: A shape, i.e., subclass of the class `RSShape` is responsible to model a visual element. 

*Collaborators*: A shape is meaningful when inserted in a canvas

*Variables*:
- `paint`: the color of the Athens paint object used to render the visual shape
- `path`: refers to AthensCairoPath, which is a resource of a foreign object, ie., the cairo on
- `border`:
- `parent`: the parent shape
- `isFixed`: a boolean indicating if the shape is fixed (ie., not subject to the camera position and movement)

"
Class {
	#name : #RSShape,
	#superclass : #RSObjectWithProperty,
	#instVars : [
		'paint',
		'path',
		'border',
		'parent',
		'isFixed',
		'encompassingRectangle',
		'model'
	],
	#category : #'Roassal3-Core'
}

{ #category : #accessing }
RSShape class >> model: anObject [
	"Create an instance of myself with anObject as model"
	^ self new model: anObject
]

{ #category : #accessing }
RSShape class >> models: someObjects [
	"Create a RSGroup made of shapes. Each shape has an element of the argument as model."
	^ someObjects collect: [ :obj | self model: obj ] as: RSGroup.

]

{ #category : #adding }
RSShape >> accept: aVisitor [
	self subclassResponsibility 
]

{'fraction_non_alphanumeric': 0.097331583552056, 'fraction_numerical': 0.004811898512685914, 'mean_word_length': 4.167231638418079, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2109307', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1335, 'n_words': 659}