Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

SUMA_input.h

Go to the documentation of this file.
00001 #ifndef SUMA_INPUT_INCLUDED
00002 #define SUMA_INPUT_INCLUDED
00003 
00004 #define SUMA_BRUSH_BLOCK 500
00005 
00006 void SUMA_input(Widget w, XtPointer clientData, XtPointer callData) ;
00007 int SUMA_MarkLineSurfaceIntersect (SUMA_SurfaceViewer *sv, SUMA_DO *dov);
00008 void SUMA_momentum(XtPointer clientData, XtIntervalId *id);
00009 SUMA_Boolean  SUMA_AddToBrushStroke (SUMA_SurfaceViewer *sv, int x, int y, GLdouble *NP, GLdouble *FP, SUMA_Boolean Show);
00010 SUMA_Boolean  SUMA_CreateBrushStroke (SUMA_SurfaceViewer *sv);
00011 void  SUMA_ClearBrushStroke (SUMA_SurfaceViewer *sv);
00012 void SUMA_ShowBrushStroke (SUMA_SurfaceViewer *sv, FILE *out);
00013 void SUMA_DrawBrushStroke (SUMA_SurfaceViewer *sv, SUMA_Boolean Incremental);
00014 void SUMA_SetSVForegroundColor (SUMA_SurfaceViewer *sv, const char *Color);
00015 SUMA_DRAWN_ROI * SUMA_ProcessBrushStroke (SUMA_SurfaceViewer *sv, SUMA_BRUSH_STROKE_ACTION BsA);
00016 SUMA_Boolean SUMA_BrushStrokeToNodeStroke (SUMA_SurfaceViewer *sv);
00017 SUMA_ROI_DATUM *SUMA_NodeStrokeToConnectedNodes (SUMA_SurfaceViewer *sv); 
00018 SUMA_ROI_DATUM *SUMA_LinkTailNodeToNodeStroke (SUMA_SurfaceViewer *sv, SUMA_DRAWN_ROI *DrawnROI);
00019 DListElmt * SUMA_PushActionStack (  DList *ActionStack, DListElmt *StackPos, 
00020                                     SUMA_ACTION_RESULT (*ActionFunction)(void *ActionData, SUMA_ACTION_POLARITY Pol), 
00021                                     void *ActionData, 
00022                                     void (*ActionDataDestructor)(void *Actiondata));
00023 SUMA_ACTION_RESULT SUMA_AddToTailROIDatum (void *data, SUMA_ACTION_POLARITY Pol);
00024 SUMA_ACTION_RESULT SUMA_AddToTailJunctionROIDatum (void *data, SUMA_ACTION_POLARITY Pol);
00025 void SUMA_DestroyROIActionData (void *data);
00026 SUMA_ROI_DATUM *SUMA_LinkThisNodeToNodeInStroke (SUMA_SurfaceViewer *sv, int NonSurf, DListElmt *El);
00027 DListElmt * SUMA_UndoAction (DList *ActionStack, DListElmt *StackPos);
00028 DListElmt * SUMA_RedoAction (DList *ActionStack, DListElmt *StackPos);
00029 void SUMA_FreeBSDatum (void *bsd);
00030 SUMA_BRUSH_STROKE_DATUM * SUMA_CreateBSDatum(void);
00031 SUMA_ACTION_RESULT SUMA_AddFillROIDatum (void *data, SUMA_ACTION_POLARITY Pol);
00032 SUMA_ACTION_RESULT SUMA_FinishedROI (void *data, SUMA_ACTION_POLARITY Pol);
00033 void SUMA_LookAtCoordinates (char *s, void *data);
00034 void SUMA_SetLight0 (char *s, void *data);
00035 void SUMA_JumpIndex (char *s, void *data);
00036 void SUMA_JumpXYZ (char *s, void *data);
00037 void SUMA_JumpFocusNode (char *s, void *data);
00038 void SUMA_JumpFocusFace (char *s, void *data);
00039 void SUMA_HighlightBox (char *s, void *data);
00040 void SUMA_SetNumForeSmoothing (char *s, void *data);
00041 
00042 /*!
00043    \brief Macro to retrieve the first node and first triangle intersected by a brushstroke 
00044    Since not all elements of brushstroke have a surface node, the macro continues searching until
00045    a non-negative SurfNode is found. Note that SurfTri is not monitored.
00046    
00047    \param bs (DList *) containing brushstroke
00048    \param fn (int) the first SurfNode (>= 0) of the list
00049    \param ft (int) the value of SurfTri corresponding to fn 
00050    \param NE (DList_Elmt *) pointer to list element where the first SurfNode was found
00051 */
00052 #define SUMA_BS_FIRST_SURF_NODE(bs, fn, ft, NE)   \
00053    {  \
00054       SUMA_BRUSH_STROKE_DATUM *m_bsd=NULL;  \
00055       \
00056       if (!dlist_size(bs)) {  \
00057          fn = -1; \
00058          ft = -1; \
00059       } else { \
00060          do {  \
00061             if (!NE) NE = dlist_head(bs);   \
00062             else NE = NE->next; \
00063             m_bsd = (SUMA_BRUSH_STROKE_DATUM *)NE->data;  \
00064             fn = m_bsd->SurfNode;   \
00065             ft = m_bsd->SurfTri; \
00066          } while ( (NE != dlist_tail(bs)) && fn < 0);   \
00067       }  \
00068    }
00069 
00070 /*!
00071    \brief Find the next element in bs that contains a non-negative value for SurfNode
00072    returns NULL in El if failed to find such an element
00073 */
00074 #define SUMA_BS_NEXT_SURF_NODE(bs, oEl, El) \
00075    {  \
00076       SUMA_BRUSH_STROKE_DATUM *m_bsd=NULL;  \
00077       \
00078       if (oEl == dlist_tail (bs))   {\
00079          El = NULL;  \
00080       }  else {   \
00081          El = oEl;   \
00082          do {  \
00083             El = El->next;   \
00084             m_bsd = (SUMA_BRUSH_STROKE_DATUM *)El->data; \
00085          }  while (El != dlist_tail(bs) && m_bsd->SurfNode < 0);  \
00086          if (m_bsd->SurfNode < 0) El = NULL; \
00087       }  \
00088    }
00089 
00090 #define SUMA_BS_COUNT_SURF_NODES(bs, N_SurfNode)  \
00091    {  \
00092       SUMA_BRUSH_STROKE_DATUM *m_bsd=NULL;  \
00093       DListElmt *m_El=NULL;  \
00094       \
00095       N_SurfNode = 0;   \
00096       do {  \
00097             if (!m_El) m_El = dlist_head(bs);   \
00098             else m_El = m_El->next;   \
00099             m_bsd = (SUMA_BRUSH_STROKE_DATUM *)m_El->data; \
00100             if (m_bsd->SurfNode >= 0) ++N_SurfNode;   \
00101          } while (m_El != dlist_tail(bs));   \
00102    }
00103 
00104 #define SUMA_REMOVE_NEXT_NON_DECIMATED(bs, Eli, Eln)   \
00105    {  \
00106       SUMA_BRUSH_STROKE_DATUM *m_bsd=NULL;  \
00107       SUMA_Boolean m_wasDecimated;  \
00108       do {  \
00109          Eln = Eli->next;   \
00110          m_bsd = (SUMA_BRUSH_STROKE_DATUM *)Eln->data; \
00111          if (m_bsd->Decimated) { \
00112             m_wasDecimated = YUP;   \
00113             dlist_remove (bs, Eln, (void *)(&m_bsd)); \
00114             SUMA_FreeBSDatum (m_bsd);  \
00115          } else {  \
00116             m_wasDecimated = NOPE;   \
00117          }  \
00118       } while (Eln != dlist_tail(bs) && m_wasDecimated);   \
00119       if (m_bsd->Decimated) Eln = NULL;   \
00120    }
00121 
00122 #endif
00123 
00124             
 

Powered by Plone

This site conforms to the following standards: