//--------------------------------------------------------------------------------------- void z_ed3View::OnLButtonUp(UINT nFlags, CPoint point) { _mm._ldown = 0; if(_mm._rdown==0) { if(GetCapture() == this) ReleaseCapture(); if(_scrPoint.x!=0) SetCursorPos(_scrPoint.x, _scrPoint.y); ShowTheCursor(); } if(!_rotating ) { _EL_SEL sel = DOC()->_selmode; if(SEL_NONE!=sel && DOC()->_blocksel==FALSE) { DOC()->DoSelection3D(point, this, sel); } } DOC()->Invalidate(); if(!_blockMouseCall) CView::OnLButtonUp(nFlags, point); }
//--------------------------------------------------------------------------------------- void z_ed3View::Project3D(int iWidth, int iHeight) { MakeCurrent(_hdc, m_hRC); if(iHeight == 0) iHeight = 1; if(DOC()->b_whitebk) { glClearColor(.8f, .8f, .8f, 0.0f); } else { if(DOC()->_bShowCsg) glClearColor(0.11f, 0.11f, 0.11f, 0.0f); else glClearColor(.02f, .02f, .04f, 0.0f); } REAL farCam = _ffar; /* if(SCENE()._si.fogFar) farCam = SCENE()._si.fogFar*_ffar; */ glViewport(0, 0, iWidth, iHeight); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(_fov,(GLfloat)iWidth/(GLfloat)iHeight, _fnear, farCam); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); // MakeCurrent(_hdc, 0); }
Value DocumentSourceGroup::serialize(bool explain) const { MutableDocument insides; // add the _id if (_idFieldNames.empty()) { invariant(_idExpressions.size() == 1); insides["_id"] = _idExpressions[0]->serialize(explain); } else { // decomposed document case invariant(_idExpressions.size() == _idFieldNames.size()); MutableDocument md; for (size_t i = 0; i < _idExpressions.size(); i++) { md[_idFieldNames[i]] = _idExpressions[i]->serialize(explain); } insides["_id"] = md.freezeToValue(); } // add the remaining fields const size_t n = vFieldName.size(); for(size_t i = 0; i < n; ++i) { intrusive_ptr<Accumulator> accum = vpAccumulatorFactory[i](); insides[vFieldName[i]] = Value(DOC(accum->getOpName() << vpExpression[i]->serialize(explain))); } if (_doingMerge) { // This makes the output unparsable (with error) on pre 2.6 shards, but it will never // be sent to old shards when this flag is true since they can't do a merge anyway. insides["$doingMerge"] = Value(true); } return Value(DOC(getSourceName() << insides.freeze())); }
Value DocumentSourceCursor::serialize(bool explain) const { // we never parse a documentSourceCursor, so we only serialize for explain if (!explain) return Value(); Lock::DBRead lk(_ns); Client::Context ctx(_ns, storageGlobalParams.dbpath, /*doVersion=*/false); ClientCursorPin pin(_cursorId); ClientCursor* cursor = pin.c(); uassert(17135, "Cursor deleted. Was the collection or database dropped?", cursor); Runner* runner = cursor->getRunner(); runner->restoreState(); return Value(DOC(getSourceName() << DOC("query" << Value(_query) << "sort" << (!_sort.isEmpty() ? Value(_sort) : Value()) << "limit" << (_limit ? Value(_limit->getLimit()) : Value()) << "fields" << (!_projection.isEmpty() ? Value(_projection) : Value()) // << "indexOnly" << canUseCoveredIndex(cursor) // << "cursorType" << cursor->c()->toString() ))); // TODO get more plan information }
void CMainFrame::OnGlobals() { CDlgGs d; d.DoModal(); DOC()->SetFaceMode(); DOC()->SetLightMode(); DOC()->Invalidate(1); }
void DocumentSourceSort::serializeToArray(vector<Value>& array, bool explain) const { if (explain) { // always one Value for combined $sort + $limit array.push_back(Value( DOC(getSourceName() << DOC("sortKey" << serializeSortKey() << "limit" << (limitSrc ? Value(limitSrc->getLimit()) : Value()))))); } else { // one Value for $sort and maybe a Value for $limit array.push_back(Value(DOC(getSourceName() << serializeSortKey()))); if (limitSrc) { limitSrc->serializeToArray(array); } } }
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) { if(m_bshutdown==0 && CZ_ed2Doc::PDoc) { DOC()->_cmdMsg = 0; } BOOL b = CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); if(CZ_ed2Doc::PDoc && m_bshutdown==0) { if(0 == DOC()->_cmdMsg) DOC()->OnCmdMsg(nID, nCode, pExtra, pHandlerInfo); } return b; }
object_t *lambda_f (object_t * lst) { DOC ("Create an anonymous function."); if (!is_func_form (lst)) THROW (c_sym ("bad-function-form"), UPREF (lst)); return c_cons (lambda, UPREF (lst)); }
namespace standard { const char* TCToTotal::name = "TCToTotal"; const char* TCToTotal::category = "Envelope/SFX"; const char* TCToTotal::description = DOC("This algorithm calculates the ratio of the temporal centroid to the total length of a signal envelope. This ratio shows how the sound is 'balanced'. Its value is close to 0 if most of the energy lies at the beginning of the sound (e.g. decrescendo or impulsive sounds), close to 0.5 if the sound is symetric (e.g. 'delta unvarying' sounds), and close to 1 if most of the energy lies at the end of the sound (e.g. crescendo sounds).\n" "\n" "Please note that the TCToTotal ratio is not defined for a zero signal (a signal consisting of only zeros), nor it is defined for a signal of less than 2 elements." "An exception is thrown if the given envelope's size is not larger than 1. And also if the integral of the input envelope is 0 (i.e. envelope is only zeros or if its sum is 0).\n\n" "This algorithm is intended to be plugged after the Envelope algorithm"); void TCToTotal::compute() { const vector<Real>& envelope = _envelope.get(); Real& TCToTotal = _TCToTotal.get(); if (envelope.size() < 2) { throw EssentiaException("TCToTotal: the given envelope's size is not larger than 1"); } double num = 0.0; double den = 0.0; for (int i=0; i<int(envelope.size()); i++) { num += envelope[i] * i; den += envelope[i]; } if (den == 0) { throw EssentiaException("TCToTotal: the given envelope consists only of zeros, or the integral of the signal is zero (i.e. given data is not a signal envelope)"); } double centroid = num / den; TCToTotal = centroid / double(envelope.size()-1); } } // namespace standard
//--------------------------------------------------------------------------------------- // cool effect durring union LRESULT CMainFrame::OnPostRepaint(WPARAM pbr1, LPARAM pbr2) { DOC()->DeselectAll(); if(pbr1) { ((Brush*) pbr1)->Select(); ((Brush*) pbr2)->Select(); } int view = 3; switch(--view) { case 0: m_wndSplitter.GetPane(1,0)->SendMessage(WM_USR_REPAINT); return 0; case 1: m_wndSplitter.GetPane(0,1)->SendMessage(WM_USR_REPAINT); break; case 2: m_wndSplitter.GetPane(1,1)->SendMessage(WM_USR_REPAINT); break; case 3: m_wndSplitter.GetPane(0,0)->SendMessage(WM_USR_REPAINT); break; } return 0; }
object_t *lisp_print (object_t * lst) { DOC ("Print object or sexp in parse-able form."); REQ (lst, 1, c_sym ("print")); obj_print (CAR (lst), 1); return NIL; }
namespace standard { const char* Trimmer::name = "Trimmer"; const char* Trimmer::description = DOC("Given an audio signal, this algorithm it extracts a slice of the signal between startTime and endTime.\n" "Giving \"startTime\" greater than \"endTime\" will raise an exception."); void Trimmer::configure() { Real sampleRate = parameter("sampleRate").toReal(); _startIndex = (long long)(parameter("startTime").toReal() * sampleRate); _endIndex = (long long)(parameter("endTime").toReal() * sampleRate); if (_startIndex > _endIndex) { throw EssentiaException("Trimmer: startTime cannot be larger than endTime."); } } void Trimmer::compute() { const vector<Real>& input = _input.get(); vector<Real>& output = _output.get(); int size = input.size(); if (_startIndex < 0) _startIndex = 0; if (_startIndex > size) { //throw EssentiaException("Trimmer: cannot trim beyond the size of the input signal"); _startIndex = size; } if (_endIndex > size) _endIndex = size; size = _endIndex-_startIndex; output.resize(size); memcpy(&output[0], &input[0]+_startIndex, size*sizeof(Real)); } } // namespace essentia
/* * Class: org_xmlsoft_Node * Method: previousImpl * Signature: ()Lrath/libxml/Node; */ JNIEXPORT jobject JNICALL Java_org_xmlsoft_Node_previousImpl (JNIEnv *env, jobject obj) { xmlNode *node = findNode(env, obj); if (node->prev==NULL ) return NULL; return buildNode(env, node->prev, DOC(obj)); }
Value DocumentSourceGeoNear::serialize(bool explain) const { MutableDocument result; if (coordsIsArray) { result.setField("near", Value(BSONArray(coords))); } else { result.setField("near", Value(coords)); } // not in buildGeoNearCmd result.setField("distanceField", Value(distanceField->getPath(false))); result.setField("limit", Value(limit)); if (maxDistance > 0) result.setField("maxDistance", Value(maxDistance)); result.setField("query", Value(query)); result.setField("spherical", Value(spherical)); result.setField("distanceMultiplier", Value(distanceMultiplier)); if (includeLocs) result.setField("includeLocs", Value(includeLocs->getPath(false))); result.setField("uniqueDocs", Value(uniqueDocs)); return Value(DOC(getSourceName() << result.freeze())); }
//--------------------------------------------------------------------------------------- void z_ed3View::OnDestroy() { Ta.Disable(); CView::OnDestroy(); --DOC()->_viewCount; }
object_t *lisp_cond (object_t * lst) { DOC ("Eval car of each argument until one is true. Then eval cdr of\n" "that argument."); object_t *p = lst; while (p != NIL) { if (!CONSP (p)) THROW (improper_list, UPREF (lst)); object_t *pair = CAR (p); if (!CONSP (pair)) THROW (wrong_type, UPREF (pair)); if (!LISTP (CDR (pair))) THROW (improper_list, UPREF (pair)); if (CDR (pair) == NIL) return UPREF (CAR (pair)); if (CDR (CDR (pair)) != NIL) THROW (c_sym ("bad-form"), UPREF (pair)); object_t *r = eval (CAR (pair)); if (r != NIL) { obj_destroy (r); return eval (CAR (CDR (pair))); } p = CDR (p); } return NIL; }
/* * Class: org_xmlsoft_Node * Method: getParentImpl * Signature: ()Lrath/libxml/Node; */ JNIEXPORT jobject JNICALL Java_org_xmlsoft_Node_getParentImpl (JNIEnv *env, jobject obj) { xmlNode *node = findNode(env, obj); // if( node->parent!=NULL && node->parent->type==XML_DOCUMENT_NODE) { // // } return buildNode(env, node->parent, DOC(obj)); }
object_t *nullp (object_t * lst) { DOC ("Return t if object is nil."); REQ (lst, 1, c_sym ("nullp")); if (CAR (lst) == NIL) return T; return NIL; }
object_t *stringp (object_t * lst) { DOC ("Return t if object is a string."); REQ (lst, 1, c_sym ("stringp")); if (STRINGP (CAR (lst))) return T; return NIL; }
object_t *numberp (object_t * lst) { DOC ("Return t if object is a number."); REQ (lst, 1, c_sym ("numberp")); if (NUMP (CAR (lst))) return T; return NIL; }
object_t *symbolp (object_t * lst) { DOC ("Return t if object is a symbol."); REQ (lst, 1, c_sym ("symbolp")); if (SYMBOLP (CAR (lst))) return T; return NIL; }
object_t *listp (object_t * lst) { DOC ("Return t if object is a list."); REQ (lst, 1, c_sym ("listp")); if (LISTP (CAR (lst))) return T; return NIL; }
object_t *funcp (object_t * lst) { DOC ("Return t if object is a function."); REQ (lst, 1, c_sym ("funcp")); if (FUNCP (CAR (lst))) return T; return NIL; }
object_t *floatp (object_t * lst) { DOC ("Return t if object is a floating-point number."); REQ (lst, 1, c_sym ("floatp")); if (FLOATP (CAR (lst))) return T; return NIL; }
object_t *symbol_name (object_t * lst) { DOC ("Return symbol name as string."); REQ (lst, 1, c_sym ("symbol-name")); if (!SYMBOLP (CAR (lst))) THROW (wrong_type, UPREF (CAR (lst))); return c_strs (xstrdup (SYMNAME (CAR (lst)))); }
object_t *integerp (object_t * lst) { DOC ("Return t if object is an integer."); REQ (lst, 1, c_sym ("integerp")); if (INTP (CAR (lst))) return T; return NIL; }
object_t *vectorp (object_t * lst) { DOC ("Return t if object is a vector."); REQ (lst, 1, c_sym ("vectorp")); if (VECTORP (CAR (lst))) return T; return NIL; }
object_t *defmacro (object_t * lst) { DOC ("Define a new macro."); if (!SYMBOLP (CAR (lst)) || !is_func_form (CDR (lst))) THROW (c_sym ("bad-function-form"), UPREF (lst)); object_t *f = c_cons (macro, UPREF (CDR (lst))); SET (CAR (lst), f); return UPREF (CAR (lst)); }
object_t *lisp_value (object_t * lst) { DOC ("Get value stored in symbol."); REQ (lst, 1, c_sym ("value")); if (!SYMBOLP (CAR (lst))) THROW (wrong_type, c_cons (c_sym ("value"), CAR (lst))); return UPREF (GET (CAR (lst))); }
//--------------------------------------------------------------------------------------- void CBigTerrain::Clear(BOOL delB) { if(delB && p_dummyBrush) DOC()->DeleteBrush(p_dummyBrush,0); p_dummyBrush = 0; v_vxes.Destroy(); n_xtiles=0; n_ztiles=0; }