Thursday, June 2, 2011

Possible switch to wxWidgets

The original source files for sodaCAD were written in gtkmm and Glade. I liked the direction that the gtkmm developers were headed and loved the visual look of the widgets. But I’ve been having problems properly connecting the signals in the XML file to the source code. Gtkmm is pretty cutting edge and has a ways to go. Glade is nice but there seem to be bugs either with gtkmm or Glade. I’m not sure. In the end, I would have had to hard code the visual layout instead of using Glade as I had wanted and it would have resulted in a lot of effort. I originally selected it because Inkscape, one of my favorite projects, uses gtkmm. Unfortunately, Inkscape has taken their GUI private and I haven’t been able to decipher it. I also think most of their GUI is hard coded in header and CPP files making it difficult to piece together. I can understand their decision, but it makes it harder to play with the code.

I’m currently studying wxWidgets and I like what I’ve seen so far. wxWidgets has been used by other CAD software, so it may be more powerful, or at least more stable, than other GUI libraries. Switching to wxWidgets means scrapping what I’ve done so far and starting over, which thankfully isn’t too far. In the coming days I will update the Git repository with the changes.

For non-software programming geeks wxWidgets and gtkmm are special code libraries that enable programmers to build a graphical user interface. There are several possibilities in hacker land and the selection depends a lot on the programming language and the preference of the developers.

Style

Coding Style

Please refer to the post on programming code style for more information.

Icons

The Tango Icon Naming Theme and Standard should be utilised to create a consistent visual appearance across platforms. Some icons may be used from the Art Libre Set, but it is unclear whether or how this icon set can be used. This project will require the creation of many custom icons. It is highly encouraged that contributing artists use Inkscape or Gimp and that the icons comply with Tango standards.

Glossary

sodaCAD is an enterprise level 2-D vector based drafting program used by fashion designers and manufacturers to create patterns. The patterns are then graded and prepared for plotting or cutting prior to manufacturing. As the terminology used by the apparel industry is unique, it is helpful for developers to review this glossary. This glossary defines the terms and also explains how they should be applied in a CAD environment.

base size – The originating size from which a graded pattern piece is created. Typically a base size is the middle size of a size range.

cut line
– Generally, the outer edge of a pattern piece. The cut line tells the plotter or cutting machine where to cut. Interior lines may also be defined as cut lines. Typically noted by a solid line.

drill point
– A point created by drilling or punching a small hole in the pattern piece. This instructs the cutter to use a drill or punch to transfer that marking to the fabric with a drill.

grainline – a line drawn on a pattern piece to indicate placement direction on fabric. In CAD, a grainline constrains how a pattern piece can be laid and rotated, usually 1, 2, or 4 way directions.

grade point – Some point on the edge or corner of a pattern piece in which a dimensional change is applied.

grading – This refers to the process of proportionally making a pattern piece larger or smaller, thereby creating a new size.Traditionally this process requires physical moving and tracing a pattern piece multiple times. In a CAD environment this process is accomplished by duplicating an object onto a new layer and offsetting points and lines.

grading table – A chart which indicates the dimensional changes of grade points between sizes. In a CAD system, a grading table gives the dimensional changes in relative coordinates and instructs the software how a point should move when grading sizes.

nest – A grouping of pattern pieces which have been stacked on top of each other from largest to smallest.

notch – A match point on a pattern piece. Notches may be slits or shaped protrusions dependent on the type of fabric or requirements for manufacturing. Typical shapes include I, U, or V.

pattern – A pattern is a 2-D drawing on paper or oaktag which is then traced onto fabric. Once a pattern has been traced, the fabric is then cut and sewn. The pattern includes important details about how the pattern should be placed and stitched. In a CAD environment, a pattern is a 2-D vector based object complete with directional placement notation and match points.

piece list – A listing and description of pattern pieces by name. A piece list is known in the rag trade as a cutter’s must. It gives the name of the piece and how many to cut of each fabric.

piece properties
– A dialogue box that describes all aspects of the piece. It should include piece name, how many to cut, fabric, description text, flip, padding, rotational allowance, and other bits of information.

seam – An extension of a pattern piece that allows the fabric to be sewn. This is created by offsetting the points and lines a defined distance from the seam line. A seam can be defined to the interior or exterior of a pattern piece. If the seam is defined to the outside of a pattern piece, then the pattern piece will automatically become larger. A seam line is defined by a dotted line.

size – A designation assigned to a pattern piece to indicate it’s position in a range. A size is created in a grading process.

size range
– A grouping of sizes. Normal size groupings are about 5-7 sizes.

sodaCAD – The name of this software project. Some believe it was derived from the location in which it was created.

stack point – This refers to the location in which the patterns of a nest are arranged. Typically the pattern pieces are stacked on top of each other with their central points aligned. In an X,Y coordinate system, the stack point is a relative point of origin. The user should be able to define the stack point on the perimeter or interior of the pattern piece.

Top Menu Spec

  1. File
    1. New
    2. Open
    3. Open Recent
    4. Save
    5. Save As
    6. Import
    7. Export
    8. Print
    9. Plot
    10. Digitize
    11. sodaCAD Preferences
    12. Close
    13. Quit
  2. Edit
    1. Undo
    2. Redo
    3. Undo History
    4. Cut
    5. Copy
    6. Paste
    7. Duplicate
    8. Delete
    9. Select All
    10. Piece Properties
    11. Scale/Shrink
    12. Fabric/Stripes
  3. View
    1. Zoom
      1. Zoom In
      2. Zoom Out
      3. Zoom 1:1
      4. Zoom 1:2
      5. Zoom 2:1
      6. Selection
      7. Drawing
      8. Page
      9. Page Width
      10. Previous Zoom
      11. Next Zoom
      12. Zoom All
    2. Grid
    3. Guides
    4. Show/Hide
      1. Snap Controls
      2. Toolbars
      3. Toolbox
      4. Rulers
      5. Scroll bars
      6. Palette
      7. Status bar
    5. Fullscreen
    6. Piece list
    7. Piece properties
    8. Pop-up info
    9. Grading table
    10. Base size only
    11. Show seam
  4. Design
    1. Draft (draw)
      1. Round corner
      2. Align points
      3. Set points (0,0) coordinates
      4. Set start point
      5. Insert baseline in center of piece
    2. Rotate
      1. Rotate 90 degrees CW
      2. Rotate 90 degrees CCW
      3. Rotate piece, baseline, internals
      4. Rotate piece so baseline is horizontal
      5. Rotate so baseline is parallel to selected segment
      6. Custom
      7. Rotate segment
    3. Flip
      1. Horizontal
      2. Vertical
      3. Flip along selected
    4. Lock (piece)
    5. Seams
      1. Add/Remove
      2. Corners
      3. On/Off
    6. Walk
      1. Change direction
    7. Split
      1. Slice along internal
    8. Mirror
      1. Mirror along selected 2 pt. segment
      2. Fold in
      3. Fold out
    9. Create
      1. Join pieces
      2. Trace piece
    10. Pieces
      1. Remove Current
      2. Save current as new
      3. Replace selected
      4. Duplicate
    11. Measure
    12. Slash and Spread
    13. Points and Notches
      1. Add point on segment
      2. Add point next to segment
      3. Delete point
      4. Move point
      5. Add notch
    14. Move
      1. Piece
      2. Internal
      3. Move selected proportionally
      4. Move selected parallel
    15. Pleats
      1. Create box pleats
      2. Create knife pleats
    16. Buttons
      1. Insert drill holes
      2. Insert equidistant
    17. Text
    18. Darts
      1. Create
      2. Edit
      3. Open dart
      4. Open multi-dart
      5. Close dart
      6. Remove dart
      7. Copy dart
      8. Paste dart
      9. Rotate dart point
      10. Rotate around center
  5. Grading
    1. Sizes
    2. Stack Point
    3. Copy Grading
    4. Paste Grading
    5. Paste X
    6. Paste Y
    7. Paste Around
    8. Flip X Grading
    9. Flip Y Grading
    10. Equal X Grading
    11. Equal Y Grading
    12. Zero Grading
    13. Zero X
    14. Zero Y
    15. Graded Nest
    16. Grade Proportional
    17. Grade Relative
    18. Grade Rules
  6. Options
    1. Snap and select
    2. Draft setup
    3. Grid and stripes
    4. Colors and line types
    5. Fonts
    6. Working units
    7. Open move pt. dialog
    8. Auto reseam
    9. Auto update notch
    10. Lock piece
  7. Help
    1. Index
    2. Tutorials

Coding Style

Please refer to the wikipedia article on standard C++ programming conventions for more information and examples.

Indentation
Please use 4 spaces.

Vertical Spacing
Statements should be viewable from the screen without needing to scroll horizontally.

Braces
Braces related to the same function should align vertically.
 
if (a > 5)
{
  // This is ANSI C++ style
} 
 
Capitalization
Variables start with a lowercase letter.
Functions are written in camel case and should be descriptive.

MyFunction